Color contrast for accessibility: WCAG 2.1 AA ratios, explained with examples
By ValleyFill · November 18, 2026
Last checked: November 18, 2026. The success criteria and definitions quoted below are from Web Content Accessibility Guidelines (WCAG) 2.1, W3C Recommendation of 06 May 2025. The Understanding documents for 1.4.3 and 1.4.11 (both updated 04 October 2026) and the WAI tutorials and design tips in the source list were opened on November 18, 2026. Example contrast ratios were computed the same day from the WCAG 2.1 relative-luminance formula, in sRGB, and are cut to two decimal places without rounding up. 1 2 3 4 6 7
If the light-and-dark difference between text and its background is too small, the words can disappear for some readers. At Level AA, WCAG 2.1 sets testable contrast ratios for text and for the visual cues that let someone find a control, see that it has focus, or read a graphic needed to understand the content. This article looks at Success Criterion 1.4.3 Contrast (Minimum) and Success Criterion 1.4.11 Non-text Contrast, the large-text definition, the formula behind a ratio, and common failure patterns with before-and-after color pairs. The samples are illustrations, not live pages and not a complete implementation. Following these steps does not by itself make a site conformant with WCAG 2.1 or any law; test with real users and assistive technology. 1 2 6 7
The success criteria in play
Two Level AA success criteria do most of the work on contrast. The wording is quoted from WCAG 2.1. A third criterion, 1.4.6 Contrast (Enhanced), sets a higher bar at Level AAA (7:1 for normal text and 4.5:1 for large-scale text, with the same incidental and logotype exceptions). This article is about the Level AA criteria, not that AAA bar. 1 2 8
- 1.4.3 Contrast (Minimum) (Level AA). “The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for the following:” The exceptions are listed on the criterion itself: “Large-scale text and images of large-scale text have a contrast ratio of at least 3:1”; “Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement”; and “Text that is part of a logo or brand name has no contrast requirement.” 1
- 1.4.11 Non-text Contrast (Level AA). “The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s):” For user interface components, that is “Visual information required to identify user interface components and states, except for inactive components or where the appearance of the component is determined by the user agent and not modified by the author.” For graphical objects, that is “Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed.” 2
Understanding 1.4.3 unpacks the text-contrast criterion, including placeholder text and the inactive-component exception. Understanding 1.4.11 unpacks non-text contrast, including focus indicators, control boundaries and graphics. The WAI tip “Provide sufficient contrast between foreground and background,” on the Designing for Web Accessibility page, points to 1.4.3. The Carousels Tutorial styling page lists 1.4.3 (along with 1.4.1, 2.4.7 and 2.5.5) among the success criteria it combines. The Forms Tutorial’s instructions page discusses placeholder contrast and shows a CSS example, but the success-criteria list on that page is 1.3.1, 2.4.6, 3.3.2 and 4.1.2; it does not list 1.4.3. 6 7 10 11 12 13
What counts as large text
The 3:1 ratio in 1.4.3 applies only to large-scale text, not to ordinary body copy or typical button labels. WCAG 2.1 defines “large scale (text)” as “with at least 18 point or 14 point bold or font size that would yield equivalent size for Chinese, Japanese and Korean (CJK) fonts.” Understanding 1.4.3 adds notes that are not themselves the definition: point sizes “should be obtained from the user agent or calculated on font metrics in the way that user agents do,” and “14pt and 18pt are equivalent to approximately 18.5px and 24px” because “1pt = 1.333px.” A note in the definition says font size “is the size when the content is delivered. It does not include resizing that may be done by a user.” Fonts “with extraordinarily thin strokes or unusual features” are harder to read at lower contrast. If a heading is large-scale under that definition, 3:1 is the 1.4.3 threshold; otherwise the threshold is 4.5:1. 5 6
How the contrast ratio is computed
WCAG 2.1 defines the contrast ratio as “(L1 + 0.05) / (L2 + 0.05),” where “L1 is the relative luminance of the lighter of the colors, and L2 is the relative luminance of the darker of the colors.” Contrast ratios “can range from 1 to 21 (commonly written 1:1 to 21:1).” Black (#000000) against white (#FFFFFF) is 21.00:1, the top of that range. 3
Relative luminance is “the relative brightness of any point in a colorspace, normalized to 0 for darkest black and 1 for lightest white.” For sRGB, the recommendation defines L = 0.2126 * R + 0.7152 * G + 0.0722 * B, after each 8-bit channel is divided by 255; if that component is less than or equal to 0.04045, it is divided by 12.92, otherwise it uses ((component + 0.055) / 1.055) ^ 2.4. 4
Understanding 1.4.3 says the 3:1 and 4.5:1 figures “are intended to be treated as threshold values” and that “the computed values should not be rounded (e.g., 4.499:1 would not meet the 4.5:1 threshold).” Understanding 1.4.11 gives the same rule for 3:1: “2.999:1 would not meet the 3:1 threshold.” On November 18, 2026, from the formula above, #777777 against #FFFFFF is 4.478089:1, which cuts to 4.47:1 and is below 4.5:1. #767676 against #FFFFFF is 4.542225:1, which cuts to 4.54:1 and meets that threshold. 6 7
A short walk-through of the second pair: #FFFFFF is RGB (255, 255, 255), each linear component is 1, and its relative luminance is 1. #767676 is RGB (118, 118, 118). Each sRGB component is 118/255, which is greater than 0.04045, so each linear component is ((118/255 + 0.055) / 1.055) ^ 2.4, or 0.1811642442. The relative luminance is therefore 0.1811642442. The ratio is (1 + 0.05) / (0.1811642442 + 0.05) = 4.542225:1.
“For the purpose of Success Criteria 1.4.3 and 1.4.6, contrast is measured with respect to the specified background over which the text is rendered in normal usage. If no background color is specified, then white is assumed.” A further note says it is a failure “if no background color is specified when the text color is specified, because the user’s default background color is unknown and cannot be evaluated for sufficient contrast. For the same reason, it is a failure if no text color is specified when a background color is specified.” Understanding 1.4.3 also says to evaluate “the foreground and background colors obtained from the user agent, or the underlying markup and stylesheets, rather than the text as presented on screen.” 3 6
The incidental and logotype exceptions
Incidental text, in 1.4.3, is “Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content.” Logotypes are covered in one sentence: “Text that is part of a logo or brand name has no contrast requirement.” 1
Understanding 1.4.3 is explicit about what those exceptions do not cover. “This success criterion applies to text in the page, including placeholder text and text that is shown when a pointer is hovering over an object or when an object has keyboard focus. If any of these are used in a page, the text needs to provide sufficient contrast.” It also says: “Beyond logos and logotypes, text that has insufficient contrast due to corporate identity or brand guidelines is not exempted from the requirements of this criterion.” On photographs, it explains the picture exception this way: “Incidental text, such as in photographs that happen to include a street sign, are not included.” That is not the same as a headline an author places on a photograph in order to be read. The WAI designing tips page makes the same distinction: sufficient contrast “includes text on images, background gradients, buttons, and other elements. This does not apply for logos, or incidental text, such as text that happens to be in a photograph.” 6 13
Understanding 1.4.3 also says: “User Interface Components that are not available for user interaction (e.g., a disabled control in HTML) are not required to meet contrast requirements. An inactive user interface component is visible but not currently operable.” Understanding 1.4.11 repeats that paragraph for non-text contrast. Our reading of that description is that a control that still works is not inactive, even if its styling is pale enough to look unused. 6 7
Common failures, with computed examples
Each pair below was computed from the WCAG 2.1 formula on November 18, 2026, in sRGB. The two-decimal figures are cut, not rounded up. They are examples, not a required palette, and they do not by themselves make a page conformant.
Placeholder text
Placeholder text is text. Understanding 1.4.3 says so in the sentence quoted above. The Forms Tutorial’s instructions page notes that, “At the time of writing this tutorial, web browsers usually display the placeholder text in a color that does not meet the minimum contrast requirement of WCAG,” and that browsers “use a combination of color and opacity to achieve this effect.” It shows a CSS snippet that “sets the color to a light gray, which has just enough contrast to meet the contrast requirement, assuming the background of the element is white”: color: #767676 and opacity: 1. On white, that pair is the 4.54:1 example already walked through. The same page says placeholder text “is not a replacement for labels,” a point covered in our guide to accessible form labels and error messages. 6 10
Before. #999999 on #FFFFFF: 2.849028:1, which cuts to 2.84:1, below both 4.5:1 and 3:1. After. The tutorial’s #767676 with opacity: 1, on the same white field: 4.542225:1, which cuts to 4.54:1, which meets the 4.5:1 normal-text threshold on white. If the field’s background is not white, recompute against the actual background. 10
/* Example only: a light gray used as placeholder text. */
input::placeholder {
color: #999999;
}
/* Example only: the tutorial gray, #767676, with opacity 1. */
::placeholder {
color: #767676;
opacity: 1;
}
Buttons that look inactive but are not
If a control is truly inactive, the incidental exception applies, in the words already quoted. If it can still be used, the label has to meet the text threshold that fits its size. Typical button text is not large-scale, so the comparison is 4.5:1.
Before. White text (#FFFFFF) on a medium blue (#4A90D9): 3.342659:1, which cuts to 3.34:1, below 4.5:1. After. White text on a darker blue (#0B5CAB): 6.702535:1, which cuts to 6.70:1, which meets the 4.5:1 normal-text threshold.
/* Example only: a white label on a medium blue. */
.button {
color: #ffffff;
background-color: #4A90D9;
}
/* Example only: a white label on a darker blue. */
.button {
color: #ffffff;
background-color: #0B5CAB;
}
A second pattern is an active control styled to look disabled. Before. #9A9A9A on #EDEDED: 2.403563:1, which cuts to 2.40:1, below both 4.5:1 and 3:1. After. #1A1A1A on #F2F2F2: 15.546592:1, which cuts to 15.54:1.
/* Example only: an active control styled to look unavailable. */
button.continue {
color: #9A9A9A;
background-color: #EDEDED;
border: none;
}
/* Example only: the same active control, with darker text. */
button.continue {
color: #1A1A1A;
background-color: #F2F2F2;
}
Text over images
When text sits on a photograph or a gradient, the background is no longer a single specified color. Contrast “is measured with respect to the specified background over which the text is rendered in normal usage.” The WAI Carousels Tutorial styling page, which lists 1.4.3 among its success criteria, says: “This can be a challenge when text or buttons are positioned on top of images. In that case, a (semi-) opaque background color can help to maintain the contrast regardless of the image used.” 3 12
The numbers below do not come from a particular photograph. They use a stand-in mid-tone, #A3B0B8, as an example of a lighter region that white letters might sit on. Before. White text (#FFFFFF) against that mid-tone: 2.219972:1, which cuts to 2.21:1, below both 4.5:1 and 3:1. On a real image the ratio would change from letter to letter. After. The same white text on a solid dark panel (#1B2A36): 14.674474:1, which cuts to 14.67:1, which meets the 4.5:1 normal-text threshold and no longer depends on the photograph. If you use a semi-opaque overlay, measure the color that actually appears behind the text once the image and overlay are combined.
<!-- Example only. White text sits directly on a photograph.
Contrast then depends on whichever part of the image is behind the letters. -->
<div class="hero">
<h1>Hours and location</h1>
</div>
<!-- Example only. A solid panel gives the text a known background color. -->
<div class="hero">
<div class="hero-panel">
<h1>Hours and location</h1>
</div>
</div>
.hero-panel {
color: #ffffff;
background-color: #1B2A36;
padding: 1rem;
}
Focus indicators and control borders
Success Criterion 2.4.7 Focus Visible (Level AA) says: “Any keyboard operable user interface has a mode of operation where the keyboard focus indicator is visible.” Understanding 1.4.11 adds: “In combination with 2.4.7 Focus Visible, the visual focus indicator for a component must have sufficient contrast against the adjacent background when the component is focused, except where the appearance of the component is determined by the user agent and not modified by the author.” The 1.4.11 threshold is 3:1 against adjacent color(s). Author-supplied hover treatments, the same document says, “can be considered supplemental and do not themselves need to contrast 3:1 against the background.” Separately, it says the component “must not lose contrast with the adjacent colors.” Our reading of the focus-indicator paragraph is that a custom focus indicator is not in that supplemental category. 9 7 2
Understanding 1.4.11 includes a failing example of an author-styled gray indicator, #AAA against #FFF, described as “an insufficient ratio of 2.3:1.” Computed on November 18, 2026, that pair is 2.323123:1, which cuts to 2.32:1. The document’s 2.3:1 figure matches this value to one decimal place; the unrounded value is below 3:1. Before. A 2-pixel outline in #AAAAAA on #FFFFFF: 2.32:1 (unrounded 2.323123:1), below 3:1. After. A 2-pixel outline in #005FCC on the same white background: 5.984935:1, which cuts to 5.98:1, which meets the 3:1 non-text threshold. 7
/* Example only: a pale gray ring around a focused control. */
button:focus {
outline: 2px solid #AAAAAA;
}
/* Example only: a stronger blue ring around a focused control. */
button:focus {
outline: 2px solid #005FCC;
}
The same 3:1 test applies to “visual information required to identify” a control when that information is the only cue that the control is there. Understanding 1.4.11 says a visible boundary is not required when the control already has visible content, such as text, that identifies it. When a border is what reveals an otherwise empty text input, that border is in scope. The document’s passing example uses a grey border of #767676; against white, that is the 4.54:1 pair already computed. 7
Non-text contrast: controls, focus, and graphics
Understanding 1.4.11 states the intent as ensuring that “user interface components (i.e., controls) and meaningful graphics are distinguishable by people with moderately low vision.” Unless a control is inactive, “any visual information provided that is necessary for a user to identify that a control is present and how to operate it must have a minimum 3:1 contrast ratio with the adjacent colors.” State indicators needed to see that a component is selected or focused have the same 3:1 bar. 7
For graphics, only “parts of graphics required to understand the content” are in scope, except “when a particular presentation of graphics is essential to the information being conveyed.” A “graphical object” may be a stand-alone icon, such as a print icon with no text, or an important part of a more complex diagram, “such as each line in a graph.” “Not every graphical object needs to contrast with its surroundings - only those that are required for a user to understand what the graphic is conveying.” 2 7
Checking a color pair
ValleyFill’s free color contrast checker runs the check in the browser: you enter a foreground color and a background color, and it reports the contrast ratio against the WCAG 2.1 thresholds for 1.4.3 (normal and large text), for 1.4.11, and, separately, for the Level AAA criterion 1.4.6. The calculation stays on your device. The ratio the tool displays is cut to two decimals and is not rounded up; pass or fail uses the full, unrounded value, which is the comparison Understanding 1.4.3 describes. 6 8
The tool checks the pair you typed. It is not a page audit and not a WCAG conformance claim for any website. It does not account for transparency, background images, gradients, text shadows or anti-aliasing, and it does not decide whether text is incidental, part of a logo, or large-scale. Those questions still need a look at the page and testing with real users and assistive technology. Other free tools and the Title II Snapshot find some issues, not all of them. For a wider walk through the Level AA criteria, see WCAG 2.1 AA in plain language and the accessibility standards guide.
A short way to review contrast
The questions below follow the criteria and the Understanding documents. They are a review aid, not a conformance test and not a statement of what any law requires of a particular site.
- Do regular text and images of text reach 4.5:1 against the background on which they are rendered, and does large-scale text, as WCAG 2.1 defines it, reach 3:1? 1 5
- When a computed ratio is compared with those thresholds, is it being compared without rounding? 6
- Does placeholder text, hover text and focus text meet the same text-contrast test? 6
- If text sits on a photograph or a gradient, has contrast been checked against the colors that actually appear behind the letters, or has the text been given a solid or opaque panel? 3 12
- If a control is still operable, is it being treated as active, not as an inactive component? 6 7
- If a focus indicator or other state cue is styled by the author, does that visual information reach 3:1 against the adjacent color or colors? 2 7 9
- Do the parts of icons or diagrams needed to understand the content reach 3:1 against adjacent colors, unless a particular presentation is essential to what is being conveyed? 2 7
If you want to look at your own pages, our free tools, including the color contrast checker, and the Title II Snapshot are a place to start. Our free tools and automated audits can help you find some issues to fix. They are not legal advice or a compliance guarantee.
About us and this post. ValleyFill sells automated accessibility audits and monitoring, and the Title II Snapshot is our own automated tool. The color contrast checker is one of our free tools. Automated tools, ours included, cannot make a site conformant on their own; they find only some barriers. A contrast checker can tell you the ratio of two colors you enter. It cannot tell you whether a control is truly inactive, whether text is part of a logo, or whether letters stay readable across every part of a photograph.
Sources
Each source was opened and checked on November 18, 2026. The success criteria and glossary definitions are quoted from the WCAG 2.1 recommendation. The Understanding documents, WAI tutorials and WAI design tips are W3C guidance on interpreting and implementing those criteria; they are not themselves success criteria.
- WCAG 2.1 Success Criterion 1.4.3 Contrast (Minimum) (Level AA). W3C Recommendation, 06 May 2025.
- WCAG 2.1 Success Criterion 1.4.11 Non-text Contrast (Level AA). W3C Recommendation, 06 May 2025.
- WCAG 2.1 definition: contrast ratio. W3C Recommendation, 06 May 2025.
- WCAG 2.1 definition: relative luminance. W3C Recommendation, 06 May 2025.
- WCAG 2.1 definition: large scale (text). W3C Recommendation, 06 May 2025.
- Understanding Success Criterion 1.4.3: Contrast (Minimum). Updated 04 October 2026.
- Understanding Success Criterion 1.4.11: Non-text Contrast. Updated 04 October 2026.
- WCAG 2.1 Success Criterion 1.4.6 Contrast (Enhanced) (Level AAA). W3C Recommendation, 06 May 2025.
- WCAG 2.1 Success Criterion 2.4.7 Focus Visible (Level AA). W3C Recommendation, 06 May 2025.
- WAI Forms Tutorial: Form Instructions. Status: Updated 13 May 2024.
- W3C Web Accessibility Initiative, Forms Tutorial (index). Status: Updated 27 March 2026 (first published September 2014).
- WAI Carousels Tutorial: Styling. Status: Updated 13 May 2024 (first published May 2015).
- WAI, Designing for Web Accessibility – Tips for Getting Started. Updated 16 July 2024.
Related ValleyFill guides
- WCAG 2.1 AA in plain language
- Accessible form labels and error messages
- Title II Snapshot vs a full accessibility audit: what each one shows
- Accessibility standards guide
This is general information, not legal advice. ValleyFill is not a law firm. For advice about your situation, talk to a lawyer.