Fix a result that looks wrong after checking color contrast with a WCAG contrast checker by confirming the two entered colors and using the threshold for the actual text category: 4.5:1 for normal AA text, 3:1 for large AA text, or 7:1 for normal AAA text. A mathematically correct result can still look poor because the formula evaluates luminance for one color pair, while your eyes also notice hue, type size, weight, transparency, background variation, glare, and display quality.
The Color Contrast Checker accepts a foreground and background through a color picker or six-digit HEX value, then returns the exact contrast ratio and AA or AAA pass/fail badges for normal text, large text, and UI contrast. Because its inputs are two colors, it does not inspect a live page, detect the rendered font size, or evaluate every pixel in a gradient, photograph, or image. It is a precise pair-level calculation, so you must supply the effective colors that appear behind the text.

What the checker actually measures
For each color pair, the checker converts the sRGB red, green, and blue channels from sRGB to linear light. It combines those values into a relative luminance using the WCAG 2.x weights of 0.2126 for red, 0.7152 for green, and 0.0722 for blue. The contrast ratio is then calculated as (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color’s luminance and L2 is the darker color’s luminance.
That formula is symmetric: swapping the foreground and background cannot change the ratio because the same two luminance values are used. Hue has no separate term in the comparison, so two colors can look clearly different to one person yet have too little luminance contrast to pass. Conversely, a passing pair can still look weak when the type is very small or thin.
The minimum contrast requirement is covered by the W3C’s WCAG 2.1 Contrast (Minimum) guidance. The checker presents the relevant requirements as pass/fail badges:
| Text or element category | Required ratio |
|---|---|
| Normal text at Level AA | At least 4.5:1 |
| Normal text at Level AAA | At least 7:1 |
| Large text at Level AA | At least 3:1 |
| Large text at Level AAA | At least 4.5:1 |
| UI components, icons, and graphical objects | At least 3:1 |
Large text means at least 18pt, approximately 24px, for regular type, or at least 14pt, approximately 18.66px, when bold. The checker provides results for the different categories, but you must select the relevant badge because the two color inputs do not reveal the page’s font size or weight.
Correct the result in the Color Contrast Checker
- Set the foreground text color. Choose the color with the picker or enter a HEX value such as #111111. Confirm that it is the final text color rather than the color of an adjacent icon, border, or label.
- Set the background color. Use the picker or type the corresponding HEX value, such as #ffffff. For a solid area, this should be the solid color directly behind the text. Do not swap the fields merely to test whether the result changes; the official ratio is symmetric.
- Read the exact ratio and all relevant badges. Compare the displayed value with the required threshold for the element. A body label should normally be judged as normal text, while qualifying large text and non-text UI elements use different thresholds.
- Identify the level you need to meet. If the page must meet AA, normal text needs 4.5:1 and large text needs 3:1. If you are targeting AAA, normal text needs 7:1 and large text needs 4.5:1. UI components, icons, and graphical objects need at least 3:1.
- Adjust either color until the required badge passes. Darkening the text or lightening the background usually increases the luminance difference when more contrast is needed. You can also adjust the background in the opposite direction. Repeat the check after each change until the appropriate result passes.
- Apply the exact tested values. Put the final foreground and background colors into the design or code. Because the checker does not scan the implementation, confirm that the rendered page uses the same values rather than an opacity, tint, or inherited color that changes the effective result.
- Test changing backgrounds as separate pairs. For a gradient, photograph, or transparent overlay, identify the lightest and darkest effective backgrounds where a letter can sit and test both against the text color. One ratio cannot describe every background position in a variable image.
Tell a calculation issue from a visual mismatch
A result can be wrong in three different ways: the entered pair may not represent the interface, the correct threshold may not have been applied, or the ratio may be accurate while the text still feels difficult to read. These situations require different responses.
| What you see | Likely explanation | What to change |
|---|---|---|
| The checker fails even though the colors have clearly different hues | The colors have similar luminance, and hue alone does not create contrast | Increase the difference between their luminance values. |
| Large text passes at 3:1, but the same treatment is used for body copy | The lower large-text threshold was applied to normal-sized text | Use the normal-text threshold: 4.5:1 for AA or 7:1 for AAA. |
| The pair passes, but small or thin text still looks weak | A WCAG minimum does not account for every typographic or viewing condition | Use more contrast than the minimum, especially for small, thin, placeholder, or decorative text. |
| Only part of the text is readable over a gradient or image | The effective background changes beneath the letters | Test the lightest and darkest points, then strengthen the local background treatment. |
| The result appears to change when the colors are swapped | One of the exact HEX inputs is different from what was expected | Re-enter both values carefully; the mathematical ratio should remain identical after swapping. |
Audit an unexpected ratio
- Re-read both HEX fields character by character. The checker can only evaluate the values submitted. A visually similar color from a screenshot can have different channel values, while a value copied from a design file may differ from the color produced by opacity or blending in the browser.
- Confirm that the two fields represent the intended pair. Use the final text and background colors. If the text changes color on hover, focus, error, or another state, test that effective pair separately.
- Check the expected mathematical range. Identical colors produce 1:1, while pure black on pure white produces 21:1. A result outside that range indicates that the inputs or the interpretation of the output need review.
- Use the WCAG luminance formula for an independent comparison. A simple distance between the raw RGB numbers is not the WCAG calculation. The relevant sRGB linearization, channel weights, lighter-color luminance, and 0.05 offsets must all be applied.
- Keep the scope of the result in view. An exact ratio for a solid pair does not certify the whole component, every state, or the presence of other accessibility cues.
The accessibility contrast ratio formula and thresholds guide provides a more detailed walkthrough of the calculation. If the exact pair, formula, and threshold agree, the displayed result is correct for that pair even if the rendered design still looks uncomfortable.
Adjust the palette without losing the design
Choose the smallest design change that closes the luminance gap. If the foreground must remain fixed, darken or lighten the background as appropriate; if the background is fixed, darken or lighten the text as appropriate. Preserving the hue while changing lightness often keeps a brand palette intact. When a single button, label, or icon fails, changing that component is usually less disruptive than rebuilding the entire palette.
Do not rely on color alone to communicate an error, selected state, required field, or other meaning. Pair color with a visible label, icon, underline, border, or other indication. This also helps when the two colors have a passing luminance contrast but remain difficult to distinguish because of hue, small type size, or the surrounding interface.
Verify the fix in the real interface
A final check should connect the calculator result to the page users will actually see:
- Compare the tested HEX values with the production design tokens, CSS declarations, and rendered component states.
- Confirm the font size and weight before choosing the normal-text or large-text result.
- Review hover, focus, error, placeholder, and disabled states against the requirements that apply to each state.
- Test the lightest and darkest effective background points behind text placed over an image, gradient, or transparency.
- Double-check thin decorative fonts and small helper text, since they can remain difficult to read even when they pass a minimum threshold.
- Re-run each corrected color pair and record the final ratio, category, and badge needed for your review.
A trustworthy contrast result depends on three separate facts: the correct effective colors were entered, the correct WCAG category was applied, and the resulting pair was checked in its real context. Once those are aligned, a failing result can be fixed by adjusting either color, while a passing result that still looks wrong should be treated as a design issue requiring a stronger contrast or clearer supporting cue.
If you're weighing options, WCAG Contrast Checker: Text, Icons, and UI Borders covers this in detail.
If you're weighing options, Verify Color Contrast Correctly in a WCAG Checker covers this in detail.