Skip to main content

Color Contrast Checker: Test WCAG 2.2 Contrast Ratios

Information about the article

Portrait of Dmitry Dugarev

Author: Dmitry Dugarev

Consultant for digital accessibility & IT compliance

Last updated on:

This color contrast checker tests two colors against WCAG 2.2. Enter a text color and a background color, and you see the contrast ratio right away. The checker tells you which of the success criteria 1.4.3, 1.4.6 and 1.4.11 the color pair passes [1]. It is for anyone who builds or fixes websites.

In short
  • Normal text needs at least 4.5:1, large text 3:1 (Level AA) [2].
  • Controls and important graphics need 3:1 against the adjacent color [3].
  • Large text means 18 pt (24 px), or 14 pt bold (18.67 px) [4], [5].
  • Never round the value. 4.499:1 does not pass the 4.5:1 threshold [5].

Check color contrast with the WCAG contrast checker​

Text color (foreground)

#RGB or #RRGGBB, for example #767676

Background color

#RGB or #RRGGBB, for example #767676

Contrast ratio

4.54 to 1

Result under WCAG 2.2
Applies toMinimumResult
Normal textCriterion 1.4.3 · Level AA4.5 : 1Pass
Large textCriterion 1.4.3 · Level AA3 : 1Pass
UI components and graphicsCriterion 1.4.11 · Level AA3 : 1Pass
Normal textCriterion 1.4.6 · Level AAA7 : 1Fail
Large textCriterion 1.4.6 · Level AAA4.5 : 1Pass
Preview

Normal text, 16 px: this is how body text looks in your colors.

Large text, 18 pt (24 px)

Large bold text, 14 pt (about 18.7 px)

Border and icon in the text color

How to use the checker:

  1. Enter the text color as a hex value, for example #767676. Or pick it in the color picker. The checker accepts #RGB and #RRGGBB, but no transparency.
  2. Enter the background color.
  3. Read the contrast ratio and the table. Each row shows the criterion, the threshold and the result.
  4. Look at the preview. It shows normal text, large text and a border in your colors.

The "Swap colors" button swaps the text and background colors. The ratio stays the same. The formula always puts the lighter color in the numerator [6]. You can use the checker with the keyboard alone. After a short pause, it announces the result to screen readers.

Take the color values from your CSS or from your browser's developer tools. The W3C recommends this too [5]. Do not measure with an eyedropper tool on screen. Anti-aliasing makes thin text look lighter there than the color set in your CSS [5].

WCAG color contrast requirements: minimum ratios​

WCAG 2.2 covers color contrast in three success criteria [1]. Two apply to text. The third applies to controls and graphics.

Applies toSuccess criterionLevelMinimum
Normal text1.4.3 Contrast (Minimum)AA4.5:1
Large text1.4.3 Contrast (Minimum)AA3:1
Controls, states, important graphics1.4.11 Non-text ContrastAA3:1
Normal text1.4.6 Contrast (Enhanced)AAA7:1
Large text1.4.6 Contrast (Enhanced)AAA4.5:1

The values come straight from the success criteria [2], [3], [7].

Why 4.5:1? It makes up for the loss in contrast sensitivity at a visual acuity of about 20/40 [5]. That acuity is typical for people around age 80 [5]. The 7:1 ratio compensates for the loss at about 20/80 [8].

Aim for Level AA. The European standard EN 301 549 requires WCAG Level AA for websites [9]. The W3C advises against requiring Level AAA across entire websites [10]. Some content cannot meet every AAA criterion [10]. In the EU, the European Accessibility Act (EAA) sets the rules. Germany implements it through the BFSG (Barrierefreiheitsstärkungsgesetz). The overview of the legal situation explains how EN 301 549 relates to the BFSG.

Criterion 1.4.11 covers everything you need to identify a control and its state [3]. Examples include the border of an input field, the check mark in a checkbox or an arrow icon in a menu [11]. It also covers the parts of a graphic you need to understand it [3]. Controls in the browser's default style are exempt, as long as you do not restyle them with CSS [3], [11].

What counts as large text? 18 pt or 14 pt bold​

WCAG defines large text as at least 18 point, or 14 point bold [4]. On the web, you work in pixels. The W3C equates 1 pt with 1.333 CSS pixels [5]. This gives you:

  • 18 pt at normal weight is 24 px.
  • 14 pt bold works out to 18.67 px. The W3C gives a rounded figure of about 18.5 px [5].

For bold large text, plan for at least 18.67 px. That is about 1.167rem at a 16 px base size. At 18.5 px, your text is just under 14 pt. Then 4.5:1 applies again.

What counts is the size the page is served at. If someone zooms in, that does not count [4]. With relative units like rem, use the computed value in the browser [5].

Watch out for very thin fonts. Fonts with extremely thin strokes are harder to read, especially at low contrast [4]. My advice: treat a thin heading like normal text and plan for 4.5:1.

How the contrast checker calculates the WCAG contrast ratio​

The checker uses the WCAG 2.2 formulas unchanged. First, it works out the relative luminance of each color. Luminance ranges from 0 for black to 1 for white [12].

// Convert an sRGB channel (0–255) to a linear value
const linear = (channel) => {
const c = channel / 255;
return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
};

// Relative luminance of a color
const luminance = ({ r, g, b }) =>
0.2126 * linear(r) + 0.7152 * linear(g) + 0.0722 * linear(b);

// Contrast ratio: L1 is the lighter color, L2 the darker one
const contrastRatio = (l1, l2) => (l1 + 0.05) / (l2 + 0.05);

The contrast ratio is (L1 + 0.05) / (L2 + 0.05). It ranges from 1:1 to 21:1 [6]. Before May 2021, the definition used 0.03928 instead of 0.04045. According to the W3C, this makes no practical difference to the result [12].

The thresholds are hard limits. The W3C is explicit: do not round [5]. So the checker cuts off the displayed value after two decimal places and never rounds up. For example, using the formula above:

  • #767676 on white gives 4.54:1 and passes AA for normal text.
  • #777777 on white gives 4.47:1 and fails.

Here, one step in the color value makes the difference. So measure every color pair, even if it looks like a close call.

Common color contrast mistakes​

Placeholder text and text on hover or focus​

Criterion 1.4.3 also applies to placeholder text in form fields [5]. It applies to text that only appears on hover or focus, too [5]. In my audits, I often find placeholders in light gray. The article on accessible forms shows how to label fields properly.

Text on images and gradients​

For text on a background image, the part of the image directly behind the text counts [13]. Check dark text against the darkest area of the image. Check light text against the lightest area [13]. If that is not enough, check the background behind each letter [13]. My advice: treat a gradient like an image and measure where the contrast is weakest. Even axe cannot reliably assess CSS gradients [14].

On WordPress sites built with Elementor or Divi, I often see this in the hero section. White text sits on a light photo. A semi-transparent dark overlay behind the text helps. Then measure the blended color of the overlay over the lightest part of the image. The checker does not handle transparency. My approach: I take a screenshot of the finished page and read the overlay color over the lightest part of the image. I measure a large area, not the text itself. For more on page builders, see the article on accessible Elementor sites.

Focus indicators and borders of controls​

The visible focus indicator needs 3:1 against the adjacent color [11]. Most focus outlines sit outside the element. In that case, you measure against the page background, not against the button color [11]. If you remove the focus outline with CSS and add no replacement, you fail 1.4.11 and 2.4.7 [15]. The browser's default focus indicator is exempt from 1.4.11, as long as you do not change it. It still has to be visible [11].

Two W3C examples show where the line is. An input field with a gray #767676 border on white passes [11]. A checkbox with a #9D9D9D border on white only reaches 2.7:1 and fails [11]. You can verify both values in the contrast checker above.

A link in body text needs two contrasts. The link text is text, so it needs 4.5:1 against the background [2]. Color must also not be the only thing that marks a link [16]. Without an underline, a contrast of at least 3:1 against the surrounding text is an accepted solution [17]. The W3C still recommends a second cue, such as an underline [17].

You can check the ratio between link and body text in the checker above. Enter the link color as the text color. Enter the body text color as the background color.

Exceptions: disabled controls, decoration and logos​

Disabled controls need no minimum contrast [5]. This means controls that are visible but cannot be used right now. An example is a submit button that only becomes active once the form is filled in [5].

Purely decorative content has no requirement either [2]. In the article Alt text for images, I explain when an image is decorative and what alt text it needs. Text in a logo or brand name is exempt [2]. The same goes for the logo graphic [11]. But a button in your brand color is not a logo. Its label needs 4.5:1, or 3:1 for large text [2].

Fix contrast issues in WordPress in one place​

Do not change a color page by page. Change it where the theme stores it. In themes with a theme.json file, the color palette is defined under settings.color.palette [18]. WordPress turns every palette color into a CSS variable such as --wp--preset--color--contrast [18].

Elementor has global colors for this. When you change a global color, it changes everywhere you used it [19]. Before you add a new palette color, test it in the contrast checker against its backgrounds.

In my audits, I often find colors that someone set directly on a single block or widget. You have to hunt down these spots one by one. For the bigger picture of making WordPress accessible, see the guide Accessible WordPress. If you do not want to do this yourself, I will handle the remediation in your existing theme.

Why automated tools miss contrast issues​

In WebAIM's 2026 study, low contrast was the most common error found automatically [20]. It appeared on 83.9% of one million home pages [20]. On average, each home page had 34 instances of low-contrast text [20]. The study itself stresses that no tool finds every error [20].

A tool reads the colors from the CSS. On a solid background, that works well. But axe's color-contrast rule lists cases it cannot reliably assess [14]:

  • Text on a background image
  • CSS gradients
  • Backgrounds from pseudo-elements such as ::before
  • Text covered by another element

The rule does not report text with a background-image at all [14]. At a ratio of 1:1, the rule returns no result. You have to check these spots by hand [14]. In my audits, I find many contrast issues in states a scan usually does not trigger: focus outlines, hover states and error messages in forms.

Our free BFSG check tests criterion 1.4.3 automatically, at least in part. Criterion 1.4.11 can only be checked manually there. A person has to identify which parts of a control matter and check their contrast in every state. In the manual audit, I check all 55 WCAG 2.2 Level A and AA criteria by hand. The BFSG audit report example shows what such a report looks like.

Frequently asked questions (FAQ)​

What contrast ratio is accessible?​

For Level AA, normal text needs 4.5:1 and large text 3:1 [2]. Controls and important graphics need 3:1 [3]. Level AAA requires 7:1 for normal text [7].

Do contrast requirements apply to buttons and icons?​

Yes. A button label is text. It needs 4.5:1, or 3:1 for large text [2]. An icon you need to operate the page needs 3:1 against the adjacent color [3]. A button without a border passes if its text makes it identifiable [11].

Do I need to meet AAA contrast?​

No. Aim for Level AA. The W3C does not recommend requiring AAA across entire websites [10]. For body text, 7:1 is still a good target if your brand colors allow it.

Do contrast requirements apply to logos?​

No. Text in a logo or brand name has no contrast requirement [2]. Logo graphics are exempt, too [11]. Buttons and links in your brand color still have to meet the thresholds.

Will APCA replace the WCAG contrast formula soon?​

Not yet. WCAG 3.0 is a working draft, not a finished standard [21]. According to the W3C, the contrast algorithm for WCAG 3.0 is not yet decided [21]. The WCAG 2.2 formula remains the benchmark.


Disclaimer​

The contrast checker only tests the color pair you enter. It does not replace a check of your pages in all their states.

The content of this article has been researched to the best of my knowledge and is for general information only. It does not constitute legal advice.

The information on studies and tools comes from the sources cited, as of September 2026. It may have changed since then.

No guarantee is given for the accuracy, completeness or timeliness of the information. Any action you take based on the information provided here is at your own risk.


​

  1. W3C, “Web Content Accessibility Guidelines (WCAG) 2.2.” 2023. [Online]. Available: https://www.w3.org/TR/WCAG22/ ⤴
  2. W3C, “Success Criterion 1.4.3 Contrast (Minimum),” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#contrast-minimum ⤴
  3. W3C, “Success Criterion 1.4.11 Non-text Contrast,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#non-text-contrast ⤴
  4. W3C, “Web Content Accessibility Guidelines (WCAG) 2.2, Definition: large scale (text).” 2024. [Online]. Available: https://www.w3.org/TR/WCAG22/#dfn-large-scale ⤴
  5. W3C, “Understanding Success Criterion 1.4.3: Contrast (Minimum).” 2026. [Online]. Available: https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html ⤴
  6. W3C, “Web Content Accessibility Guidelines (WCAG) 2.2, Definition: contrast ratio.” 2024. [Online]. Available: https://www.w3.org/TR/WCAG22/#dfn-contrast-ratio ⤴
  7. W3C, “Success Criterion 1.4.6 Contrast (Enhanced),” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#contrast-enhanced ⤴
  8. W3C, “Understanding Success Criterion 1.4.6: Contrast (Enhanced).” 2026. [Online]. Available: https://www.w3.org/WAI/WCAG22/Understanding/contrast-enhanced.html ⤴
  9. ETSI, “ETSI EN 301 549 V3.2.1 (2021-03) - Accessibility requirements for ICT products and services.” 2021. [Online]. Available: https://www.etsi.org/deliver/etsi_en/301500_301599/301549/03.02.01_60/en_301549v030201p.pdf ⤴
  10. W3C, “WCAG 2.2 - 5. Conformance.” 2023. [Online]. Available: https://www.w3.org/TR/WCAG22/#conformance-to-wcag-2-2 ⤴
  11. W3C, “Understanding Success Criterion 1.4.11: Non-text Contrast.” 2026. [Online]. Available: https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html ⤴
  12. W3C, “Web Content Accessibility Guidelines (WCAG) 2.2, Definition: relative luminance.” 2024. [Online]. Available: https://www.w3.org/TR/WCAG22/#dfn-relative-luminance ⤴
  13. W3C, “F83: Failure of Success Criterion 1.4.3 and 1.4.6 due to using background images that do not provide sufficient contrast with foreground text (or images of text),” 2023, [Online]. Available: https://www.w3.org/WAI/WCAG22/Techniques/failures/F83 ⤴
  14. Deque Systems, “Elements must meet minimum color contrast ratio thresholds (axe 4.12 rule color-contrast).” 2026. [Online]. Available: https://dequeuniversity.com/rules/axe/4.12/color-contrast ⤴
  15. W3C, “F78: Failure of Success Criterion 1.4.11, 2.4.7 and 2.4.13 due to styling element outlines and borders in a way that removes or renders non-visible the visual focus indicator,” 2023, [Online]. Available: https://www.w3.org/WAI/WCAG22/Techniques/failures/F78 ⤴
  16. W3C, “Success Criterion 1.4.1 Use of Color,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#use-of-color ⤴
  17. W3C, “G183: Using a contrast ratio of 3:1 with surrounding text and providing additional visual cues on hover for links or controls where color alone is used to identify them,” 2023, [Online]. Available: https://www.w3.org/WAI/WCAG22/Techniques/general/G183 ⤴
  18. WordPress.org, “Theme Handbook: Color (Global Settings and Styles).” 2026. [Online]. Available: https://developer.wordpress.org/themes/global-settings-and-styles/settings/color/ ⤴
  19. Elementor, “Introducing Elementor 3.0: Design System Features, New Theme Builder & Major Performance Improvements.” 2025. [Online]. Available: https://elementor.com/blog/elementor-3-new-professional-features/ ⤴
  20. WebAIM, “The WebAIM Million: The 2026 report on the accessibility of the top 1,000,000 home pages.” 2026. [Online]. Available: https://webaim.org/projects/million/ ⤴
  21. W3C, “W3C Accessibility Guidelines (WCAG) 3.0, W3C Working Draft 10 September 2026.” 2026. [Online]. Available: https://www.w3.org/TR/wcag-3.0/ ⤴

About the author

Portrait of Dmitry Dugarev

Best regards,

Dmitry Dugarev

Founder of Barrierenlos℠. I test websites by hand and fix the barriers on WordPress websites – without a relaunch.