Color Contrast and Accessibility
Contrast is the one accessibility rule you can check with arithmetic. Here is what the WCAG numbers say, where they come from, and what they do not cover.
WCAG 2.1 asks for a contrast ratio of at least 4.5:1 between text and its background, or 3:1 for large text (at least 18 point, or 14 point bold), at level AA. Level AAA raises those to 7:1 and 4.5:1. The parts of buttons, fields and charts you need to see need 3:1 against the colors next to them. Ratios run from 1:1 to 21:1, and a result is never rounded up to a pass.
Most accessibility questions need a person to judge them. Contrast is the exception: two colors go in, one number comes out, and the Web Content Accessibility Guidelines (WCAG) say which numbers are enough. The Contrast Checker does the arithmetic; this guide explains what it is measuring and why the thresholds sit where they do.
The four rules that involve color
WCAG 2.1 has four success criteria about color and contrast. Level A is the minimum, AA is what most policies ask for, and AAA is the strictest.
| Success criterion | Level | What it asks |
|---|---|---|
| 1.4.3 Contrast (Minimum) | AA | Text and images of text: at least 4.5:1; large text 3:1 |
| 1.4.6 Contrast (Enhanced) | AAA | Text and images of text: at least 7:1; large text 4.5:1 |
| 1.4.11 Non-text Contrast | AA | The parts of controls and graphics you need to see: at least 3:1 against adjacent colors |
| 1.4.1 Use of Color | A | Color is never the only way information is shown |
Both text criteria carry the same exceptions. Text in “an inactive user interface component”, text that is “pure decoration” or “not visible to anyone”, and text that is “part of a picture that contains significant other visual content” have no contrast requirement, and neither does “text that is part of a logo or brand name”.
The non-text rule covers two things: the “visual information required to identify user interface components and states”, such as the border of a text field or the check in a check box, and the “parts of graphics required to understand the content”, such as the lines of a chart.
What counts as large text
WCAG’s definition of large text is “at least 18 point or 14 point bold”. Points are a print measure, so the W3C’s Understanding document translates them for screens: “1pt = 1.333px, therefore 14pt and 18pt are equivalent to approximately 18.5px and 24px.”
Weight matters as much as size. Text at 20 pixels in a regular weight is not large under this definition; the same text in bold is.
How the ratio is worked out
The ratio compares how bright two colors are, measured in a particular way. It takes two steps.
- 1
Each color gets a relative luminance, from 0 for the darkest black to 1 for the lightest white. For ordinary screen colors, WCAG's formula is L = 0.2126 × R + 0.7152 × G + 0.0722 × B, after each channel has been converted from its 0–255 value to a linear light level.
- 2
The two luminances are compared as (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color and L2 the darker one.
The weights in the first step are why green text looks so much brighter than blue text of the same “strength”: green contributes about ten times as much as blue. The 0.05 in the second step, the W3C explains, “is based on Typical Viewing Flare”: an allowance for the stray light that falls on any real screen.
The result runs from 1:1, two identical colors, to 21:1, black on white. WCAG’s definition adds that where “no background color is specified, then white is assumed.”
WCAG's formula now uses a threshold of 0.04045 when converting each channel; before May 2021 it read 0.03928, and the W3C says the change "has no practical effect on the calculations in the context of these guidelines." The Contrast Checker still uses 0.03928. For ordinary 8-bit colors the two give identical results: 10 out of 255 is 0.0392, below both thresholds, and 11 out of 255 is 0.0431, above both.
Why 4.5:1
The number is not arbitrary. The W3C’s Understanding document explains that 3:1 is “the minimum level recommended by [ISO-9241-3] and [ANSI-HFES-100-1988] for standard text and vision”, and that the higher figure is used “to account for the loss in contrast that results from moderately low visual acuity, congenital or acquired color deficiencies, or the loss of contrast sensitivity that typically accompanies aging.”
"A user with 20/40 would thus require a contrast ratio of 3 * 1.5 = 4.5 to 1. Following analogous empirical findings and the same logic, the user with 20/80 visual acuity would require contrast of about 7:1." — W3C, Understanding 1.4.3
That is where the AAA figure comes from as well. The same document notes that 20/40 “is commonly reported as typical visual acuity of elders at roughly age 80.”
No rounding up
A ratio of 4.49:1 fails the 4.5:1 rule. The W3C is explicit that the ratios are thresholds and “the computed values should not be rounded (e.g., 4.499:1 would not meet the 4.5:1 threshold).” The Contrast Checker follows this in two ways: the figure it shows is cut off at two decimals rather than rounded, and the pass or fail beside each criterion is decided on the exact value.
Color alone is never enough
Contrast is about brightness; criterion 1.4.1 is about something else. It says color must not be “the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element.” A form that marks mistakes only by turning a border red fails it, however strong the red’s contrast is, because some readers cannot tell that red from the gray it replaced.
The fix is a second signal: an icon, a word, an underline, a pattern. The Color Blindness Simulator shows an approximation of how a screenshot reads under three kinds of color vision deficiency, which makes a color-only signal easy to spot. The Color Blindness guide explains what those deficiencies are.
Checking a pair of colors
- 1
Enter the text color and its background in the Contrast Checker, as HEX values or with its color pickers. The Color Converter turns an RGB or HSL value into HEX first.
- 2
Read the ratio and the criteria. Each pass or fail is named with its success criterion and level, so you can see whether a pair meets AA for normal text, only for large text, or AAA.
- 3
Check the pairs people forget: placeholder text in form fields, links against body text, text over images, and the border of a field against the page.
- 4
For text over a gradient, check it against the part of the gradient that gives the lowest ratio, not the average. In the Gradient Generator you choose the colors yourself, so those end colors are the ones to check.
Building a palette from one color is where most contrast problems start, because tints of a brand color drift toward the background. The Palette Generator produces the related shades from one value; each pair you plan to put text on is worth a pass through the Contrast Checker before it is used.
What a passing ratio does not tell you
A ratio is one fact about two colors. It does not say that the text is large enough to read comfortably, that the font is clear, or that anything else on the page works. Thin, light fonts can pass on paper and still be hard work, and a passing ratio says nothing at all about keyboard use, labels, headings or the many other things WCAG covers. Contrast is the part of accessibility that can be checked with a calculator; it is not the whole of it.
The rules have also held still for a while. WCAG 2.2, the W3C’s newest Recommendation, carries all four criteria and all three definitions word for word, and the W3C states that “sites which conform to WCAG 2.2 also conform to WCAG 2.1.”
Questions
Is 4.49:1 close enough to pass?
No. The W3C's own explanation says the ratios are thresholds and "the computed values should not be rounded (e.g., 4.499:1 would not meet the 4.5:1 threshold)." The Contrast Checker follows that: it cuts its figure off at two decimals rather than rounding, and tests the exact value.
What counts as large text, in pixels?
WCAG defines large text as at least 18 point, or 14 point bold. The W3C's Understanding document converts that for the web: "1pt = 1.333px, therefore 14pt and 18pt are equivalent to approximately 18.5px and 24px."
If every color pair passes, is the page accessible?
Not on that basis alone. Contrast is a few success criteria among many in WCAG, and a passing ratio is one fact about two colors. It says nothing about keyboard use, headings, labels or anything else the guidelines cover.
Did WCAG 2.2 change the contrast rules?
No. The texts of 1.4.1, 1.4.3, 1.4.6 and 1.4.11, and the definitions of contrast ratio, relative luminance and large text, are word for word the same in WCAG 2.1 and 2.2. The W3C also states that "sites which conform to WCAG 2.2 also conform to WCAG 2.1."
What if no background color is set?
WCAG's definition of contrast ratio covers that case: "If no background color is specified, then white is assumed."
How this guide was made
Every threshold, definition and formula is quoted from the W3C Recommendation for WCAG 2.1 and the W3C's Understanding document for success criterion 1.4.3, and the same passages were compared line by line with WCAG 2.2. The note on the Contrast Checker's threshold describes ScreenTail's own code and is checked by arithmetic on the 8-bit values.
No claim that any particular color pair, palette or design is accessible: a ratio is one fact about two colors. The other WCAG criteria are not covered, and neither are proposed contrast methods that are not part of a W3C Recommendation.
- 01Success criteria 1.4.1 Use of Color, 1.4.3 Contrast (Minimum), 1.4.6 Contrast (Enhanced) and 1.4.11 Non-text Contrast, and the definitions of contrast ratio, relative luminance and large scale text (W3C Recommendation, 06 May 2025 version): W3C, Web Content Accessibility Guidelines (WCAG) 2.1 — retrieved Sep 25, 2026.
- 02The rationale for the 4.5:1 and 7:1 ratios, the point-to-pixel conversion for large text, and the rule that computed ratios are not rounded: W3C WAI, Understanding Success Criterion 1.4.3: Contrast (Minimum) — retrieved Sep 25, 2026.
- 03That the contrast criteria and definitions are unchanged in WCAG 2.2, and that conforming to 2.2 also conforms to 2.1 (W3C Recommendation, 12 December 2024): W3C, Web Content Accessibility Guidelines (WCAG) 2.2 — retrieved Sep 25, 2026.