Color Contrast Analyzer


Text Preview

This text is displayed with the entered color combination.


📊 Contrast Analysis Results
Contrast Ratio:
21.00:1
AA (Large Text)
Minimum requirement: 3:1
Pass
AA (Normal Text)
Minimum requirement: 4.5:1
Pass
AAA (Large Text)
Minimum requirement: 4.5:1
Pass
AAA (Normal Text)
Minimum requirement: 7:1
Pass
✨ Color Harmony Recommendations (Base: Foreground)
Monochromatic Color
#f2f2f2
#d9d9d9
#bfbfbf
#a6a6a6
#8c8c8c
#737373
#595959
#404040
#262626
#0d0d0d
Complementary Color
#000000
#000000
Analogous Color
#000000
#000000
#000000
Triadic Color
#000000
#000000
#000000
Split Complementary Color
#000000
#000000
#000000

Check whether a foreground and background pair meets WCAG contrast requirements, and get harmonious alternatives when it does not. Contrast is the accessibility issue most likely to be flagged in an audit.

WCAG contrast is a ratio between the relative luminance of two colours, ranging from 1:1 to 21:1. The thresholds that matter are 4.5:1 for normal body text at AA, 3:1 for large text (18pt, or 14pt bold) and for interface components, and 7:1 for AAA. Those numbers are also what accessibility audits and an increasing number of procurement checklists test against.

Luminance is not brightness as you perceive it, which is why a yellow that looks vivid can fail against white while a mid-grey passes. The ratio is computed here for the pair you enter, with the pass and fail marked per threshold, so a palette decision can be made before the design is built rather than after an audit.

The contrast rule people remember is the one they get wrong most often: 3:1 applies to large text, and large means 18pt — about 24 pixels — or 14pt bold, not merely bigger than the body copy. A heading set at 20 pixels is normal text as far as the guideline is concerned and needs the full 4.5:1. The same 3:1 threshold covers interface components and meaningful graphics, which is the clause that catches icon-only buttons, focus rings and the borders of form fields, all of them things a design review tends to skip.

Contrast is computed from relative luminance, and luminance is not the lightness you perceive. The formula weights green far more heavily than red and blue, because human vision does, and it applies a gamma correction before the weighting. The practical consequence is that a saturated yellow with a luminance close to white fails against it despite looking vivid, while a mid-grey that looks unremarkable passes comfortably. This is why a palette cannot be checked by eye and why a pair that seems obviously distinguishable can still fail an audit.

Colour alone should not be the only thing carrying meaning, and that is a separate requirement from contrast rather than a consequence of it. A red field for an error and a green one for success are indistinguishable to a substantial share of readers with colour vision deficiency, and identical in a printed or greyscale copy. Adding an icon, a label or a shape keeps the information intact without removing the colour. Checking a palette here before the interface is built is considerably cheaper than discovering both problems in an accessibility review afterwards.

Text over a photograph or a gradient has no single contrast ratio, which is the case the checker cannot answer on its own. The requirement applies to the worst point behind the text, not the average, so a caption that passes over the dark half of an image fails over the bright half and the page as a whole does not comply. The usual fixes are a solid or semi-opaque panel behind the text, a scrim darkening the image under it, or a text shadow heavy enough to guarantee separation — and each of those creates a definite pair of colours that can then be checked here.

How to use Color Contrast Analyzer

  1. Enter your foreground and background colours as hex or rgb().
  2. Read the contrast ratio and whether it passes AA and AAA for normal and large text.
  3. If it fails, pick a suggested harmony colour and apply it to either layer.
  4. Copy the colour you settle on.

Tips & gotchas

  • The thresholds are 4.5:1 for normal text and 3:1 for large text at AA; AAA asks for 7:1 and 4.5:1. Large means roughly 18.66px bold or 24px regular.
  • Grey placeholder text and light-grey borders are where contrast failures cluster. Check those, not just body copy.
  • Contrast alone is not accessibility — never use colour as the only way to convey meaning.

Frequently asked questions

What contrast ratio do I actually need?

Aim for 4.5:1 on body text as a baseline. That is the AA requirement and what most audits and legal standards reference.

Do icons and form borders need to pass?

Yes. WCAG asks for 3:1 on meaningful non-text elements such as icons, focus rings and input borders.

Does contrast change with font size?

The requirement does. Large text is allowed a lower ratio because thicker strokes are easier to read at the same contrast.