Contrast & Legibility Hub
Audit single color combinations for text legibility, or test an entire 4-color palette matrix for design system accessibility.
Design System
The quick brown fox jumps over the lazy dog. Legible web design is accessible to everyone.
Understanding WCAG Contrast Requirements
The Web Content Accessibility Guidelines (WCAG) are a series of recommendations for making the web more accessible. Contrast ratio is one of the most critical aspects of accessibility, ensuring that text is readable for people with visual impairments or color blindness.
- WCAG AA: Requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18pt or 14pt bold).
- WCAG AAA: Requires a contrast ratio of at least 7:1 for normal text and 4.5:1 for large text.
Using our contrast checker tool, you can quickly verify if your color choices meet these legal and ethical standards. Simply enter your hex codes or use the color pickers to see the results instantly.
How to read a WCAG contrast result
What it does
Computes the contrast ratio between a text colour and a background colour with the WCAG 2.1 relative-luminance formula, then grades the pair AA, AAA or Fail. Matrix mode runs every colour in a palette against every other colour, so you can see which pairs are usable for text and which are only usable as fills.
When you would use it
Before shipping a colour pair for body copy, a button label, a placeholder or a disabled state; when auditing a palette someone handed you; and when a design looks fine to you but you need to know whether it is readable for someone with low vision or a cheap laptop screen in daylight.
How to use it
- Enter the text colour and the background colour, or pick them from the swatches.
- Read the ratio first and the grade second. The grade is a threshold applied to the ratio, not a separate measurement.
- Toggle the large-text threshold if the text is 24px regular or 18.66px bold, where AA drops from 4.5:1 to 3:1.
- For a whole palette, switch to matrix mode: rows are backgrounds, columns are text colours, and every cell is a real pair you could ship.
Worked example — the one-step cliff at 4.5:1
#767676 on white measures 4.54:1 and passes AA for normal text, but fails AAA, which needs 7:1. #777777 — one step darker to the eye — measures 4.48:1 and fails AA. Nothing about the design changed; a single hex digit moved the pair across the threshold. That is why the tool reports the number and not just a tick, and why “it looked fine” is not a substitute for measuring.
How the calculation works
sRGB channels are normalised to 0–1 and linearised: below 0.04045 the channel is divided by 12.92, above it the channel is raised to the power 2.4 after adding 0.055 and dividing by 1.055. Relative luminance is 0.2126 R + 0.7152 G + 0.0722 B on those linear values. The ratio is (lighter + 0.05) / (darker + 0.05), which ranges from 1:1 for identical colours to 21:1 for black on white. AA is 4.5:1 for normal text and 3:1 for large text; AAA is 7:1 and 4.5:1.
Limitations
- A ratio describes two colours. Text size, weight, letter spacing, anti-aliasing and display quality all affect real legibility, and the large-text exemption only applies at 24px regular or 18.66px bold.
- WCAG 2.1 contrast is not APCA, the candidate algorithm in WCAG 3. A pair that passes here can score differently under APCA, particularly for light text on dark backgrounds.
- Translucent colours, gradients, text over images and text over video cannot be reduced to one ratio — measure the worst-case pixel behind the text.
- The matrix shows every combination, including pairs no designer would use. Read it as a grid of candidates, not as a verdict on the palette.