Contrast checker

Pick two colours and instantly see their WCAG contrast ratio, AA/AAA results and a live preview — in your browser.

Contrast ratio
Normal text
Large text
UI & graphics

Normal text at 16px needs a ratio of 4.5:1 for AA and 7:1 for AAA.

Large headline 24px

What a contrast checker tells you

Colour contrast is the measured difference in brightness between text and the surface behind it. The Web Content Accessibility Guidelines (WCAG) express that difference as a single contrast ratio, ranging from 1:1 (two identical colours, completely unreadable) to 21:1 (pure black on pure white). This tool takes the two hex colours you enter, computes that ratio, and tells you immediately whether the pairing meets the AA and AAA thresholds for body text, large text and interface elements.

Under the hood it converts each colour to its relative luminance. Each channel is first linearised (the sRGB gamma curve is undone), then combined with the perceptual weights 0.2126·R + 0.7152·G + 0.0722·B — green counts most because our eyes are most sensitive to it. The two luminances feed the WCAG formula (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter colour. The live preview then paints your real colours so you can sanity-check the number with your own eyes.

A worked example

Take white text #FFFFFF on the brand purple #6650E8. White has a luminance of 1.0; the purple works out to about 0.11. The ratio is (1.0 + 0.05) / (0.11 + 0.05) ≈ 6.6:1. That comfortably clears AA for normal text (4.5:1) and AAA for large text (4.5:1), but it falls just short of AAA for normal text (7:1) — so a heading in this pairing is gold-standard while fine print is merely solid.

WCAG 2.1 contrast thresholds

ContentAAAAA
Normal text (under 18pt / 24px)4.5:17:1
Large text (18pt / 24px, or bold 14pt)3:14.5:1
UI components & meaningful graphics3:1n/a

A practical rule: aim for 4.5:1 everywhere you can, treat 3:1 as the absolute floor for anything interactive, and remember that contrast alone is not accessibility — never rely on colour as the only way to convey meaning, and always keep focus states visible.

Privacy note: every calculation happens in your browser. The colours you type are never uploaded, logged or stored, so you can test unreleased brand palettes without anything leaving this tab.

Frequently asked questions

What contrast ratio do I actually need?

For normal body text, WCAG AA requires at least 4.5:1 and AAA requires 7:1. For large text (18pt / 24px, or bold 14pt / 18.66px) the bar drops to 3:1 for AA and 4.5:1 for AAA. Interactive UI components and meaningful graphics need at least 3:1 against their surroundings.

How is the contrast ratio calculated?

Each colour is converted to its relative luminance — a brightness value from 0 (black) to 1 (white) that weights green more heavily than red or blue, because the human eye is most sensitive to green. The ratio is then (L_lighter + 0.05) / (L_darker + 0.05). The 0.05 term models ambient light reflected off the screen.

Why does pure black on white give 21:1?

That is the maximum possible ratio. Black has a luminance of 0 and white a luminance of 1, so the formula gives (1 + 0.05) / (0 + 0.05) = 21. Every other colour pairing falls somewhere between 1:1 (identical colours) and 21:1.

Does passing AA mean my design is fully accessible?

No. Contrast is one part of accessibility. You also need to avoid conveying meaning by colour alone, provide visible focus states, support keyboard navigation and add text alternatives. A passing ratio is necessary but not sufficient.

Are my colours sent anywhere?

No. The hex values you enter are processed entirely in your browser with JavaScript. Nothing is uploaded, logged or stored, so you can safely test unreleased brand colours.