To check color contrast with a WCAG contrast checker, enter the foreground and background colors, then compare the exact ratio with the applicable threshold: 4.5:1, 3:1, or 7:1. Level AA calls for at least 4.5:1 for normal text and 3:1 for large text; Level AAA calls for 7:1 and 4.5:1 respectively. UI components, icons, and graphical objects need at least 3:1 under the non-text rule. The Color Contrast Checker performs the calculation locally in your browser, so you can test brand colors, CSS values, and design tokens without uploading them. It returns the exact contrast ratio together with pass-or-fail badges for normal text, large text, and UI text. For a typical text check, set the foreground first—for example, #111111—then enter a background such as #ffffff. Read the results and adjust either color until the badge for the level you need passes. The checker follows the official WCAG 2.x method, including sRGB linearization and relative luminance, rather than judging contrast by eye. Two colors can look distinct to one person while still having too little luminance difference for readable text. The result also depends on which rule applies: body copy, a large heading, and a form border do not use the same target. The goal is therefore not simply to collect a number, but to identify the category the number clears and correct the pair where it does not. In practice, test the exact colors your interface will use, including text over buttons, links, form controls, and images, rather than relying on a general palette impression.

What the WCAG contrast ratio measures
WCAG 2.x calculates contrast from relative luminance. The checker first converts each sRGB color channel to linear light. It then combines the linear red, green, and blue values with weights of 0.2126, 0.7152, and 0.0722 to obtain the color’s relative luminance. The contrast ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color’s luminance and L2 is the darker color’s luminance. Ratios range from 1:1 for identical colors to 21:1 for pure black on pure white.
The order of the two colors does not change the score because L1 always represents the lighter luminance and L2 the darker one. Keeping the text in the foreground field and the background in the background field still makes the result easier to interpret and document.
| Text category | Level AA minimum | Level AAA minimum |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text | 3:1 | 4.5:1 |
For non-text content—such as UI components, form-field borders, icons, graphical objects, and focus indicators—the minimum is 3:1. A button label and its border are separate checks: the label is text, while a component boundary or focus indicator falls under non-text contrast. The W3C’s WCAG 2.1 Contrast (Minimum) guidance explains the minimum-contrast rule behind these categories.
How to check a foreground and background pair
Use the checker as a precise two-color comparison rather than judging a palette by appearance.
- Open the Color Contrast Checker. It runs in your browser, so the color values can be checked locally without uploading them.
- Set the foreground or text color. Use the color picker or type a six-digit hex value such as #111111.
- Set the background color in the same way. Enter a value such as #ffffff using the picker or the hex field.
- Read the contrast ratio and pass-or-fail badges. Check the results for normal text, large text, and UI content, then select the category that matches the element you are reviewing.
- Adjust either color and check again. Continue revising the pair until it meets the AA or AAA level required for that use.
If one category fails, change the color pair rather than treating the content as large text when it is not. Run the final check with the exact values that will appear in the design. When a color token is used against several backgrounds, test every foreground-and-background combination instead of assuming one pass applies everywhere.
Match the result to the content
WCAG defines large text as at least 18pt, or 24px, for regular-weight text and at least 14pt, approximately 18.66px, when bold. Larger and thicker strokes are easier to read, so large text is allowed a lower contrast threshold. Text below those size and weight definitions belongs in the normal-text category.
A heading may pass the large-text result while the same color fails normal body copy. Normal text needs 4.5:1 for AA or 7:1 for AAA; large text needs 3:1 for AA or 4.5:1 for AAA. Passing AA is a floor rather than a ceiling, and aiming for AAA where practical can provide more comfortable reading.
For UI content, classify the visible label as normal or large text, then check any component border, icon, or focus indicator separately under the 3:1 non-text requirement. This prevents a large-text pass from being applied to small interface copy or an icon.
Correct a color pair that fails
When a result fails, look for a way to increase the luminance difference while preserving the intended design. A hue change alone may not be enough: red on green can fail because the colors have similar brightness even though they look distinct to some viewers.
- Change luminance rather than relying only on hue. If the brand palette permits it, make the text darker or the background lighter, or use a lighter text color on a darker background.
- Test the intended size and weight. Do not treat small body copy as large text simply to use its lower threshold.
- Review common failure spots. Placeholder text, disabled states, and thin decorative fonts deserve extra attention.
- Do not rely on color alone. Pair color with text labels, icons, or underlines when color communicates a state or distinction.
- Recheck every affected combination. A change to a shared text or background token can alter the results across buttons, links, alerts, and form controls.
A failed pair does not always require a complete redesign. Keep the brand hue where possible, then adjust lightness until the relevant threshold passes. If both colors are fixed, changing the surrounding background or adding a clearer non-color cue may be necessary.
Handle gradients, overlays, and images
A flat surface can be evaluated with one foreground-and-background pair. Gradients, semi-transparent overlays, and images are more complicated because the effective background can change across the text. Identify the lightest and darkest points where a letter may sit, then enter those representative solid colors with the same foreground color. Each relevant sample should produce an acceptable result.
Because the checker evaluates one color pair at a time, a passing sample does not prove that every part of a graphic has enough contrast. Resolve an overlay to its final displayed color before testing, and avoid assuming that one point represents the entire image or gradient.
For text that crosses several visual areas, keep a record of every tested background. This makes it possible to identify the exact combination that fails instead of replacing the whole design after finding one problematic spot.
Make contrast checks repeatable
For a website, product, or design system, test meaningful foreground-and-background combinations rather than isolated swatches. A small test record can make the process much easier to repeat and review.
- Record both hex values. Include the foreground, background, intended text size, and the threshold that applies.
- Test common semantic pairs. Cover body text, headings, links, button labels, form text, error messages, and focus indicators.
- Review shared tokens in context. A text color that passes on white may fail on a colored button or tinted panel.
- Repeat checks after design updates. Re-run affected pairs whenever a brand color, theme token, font size, or background changes.
The checker’s local processing also makes it practical to test confidential brand palettes and design tokens without uploading color data. Start with the combinations used most often, record the results, and revisit them whenever the interface changes.
For a deeper look, see Color Contrast by Text Size: Which WCAG Threshold Applies?.
For a deeper look, see Choosing the Right Approach to WCAG Color Contrast Checks.