NEARFIELD·TOOLS

Color contrast checker

The contrast ratio of a text or interface colour on its background, judged against each WCAG 2.2 criterion and its EN 301 549 clause, with translucent text handled and the nearest colour that passes.

Accepts #rgb, #rrggbb, #rrggbbaa and rgb()/rgba(). An alpha in the colour and the opacity field multiply, as they do in CSS.

—:1
contrast ratio
—
level reached
—
text as rendered

Body text at 16 px reads like this.

Large text at 24 px

Bold text at 18.67 px (14 pt)

Button outline
UseWCAG 2.2EN 301 549NeedsResult

Checking a whole design rather than one pair? Nearfield Accessibility, our free Figma plugin, runs this check on every text layer and component in a frame, using the colour actually painted behind each one, and maps each finding to the same clauses.

What the ratio means

WCAG measures contrast as (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker colour. Luminance comes from the sRGB channels after undoing the display gamma, weighted 0.2126 R + 0.7152 G + 0.0722 B, because the eye is far more sensitive to green than to blue. The ratio runs from 1:1 (identical colours) to 21:1 (black on white).

Four criteria use it. 1.4.3 Contrast (Minimum), level AA, asks for 4.5:1 for text and 3:1 for large text. 1.4.6 Contrast (Enhanced), level AAA, raises those to 7:1 and 4.5:1. 1.4.11 Non-text Contrast, level AA, asks for 3:1 for the parts of a control you need in order to see it (a field's border, a checkbox, a focus ring) and for the parts of a chart or icon you need to understand it. EN 301 549, the European standard that the Accessibility Act points to, adopts the A and AA criteria word for word as clauses 9.1.4.3 and 9.1.4.11 for web content; it does not adopt AAA, so 1.4.6 has no clause. The WCAG 2.2 checklist gives the clause for every other A and AA criterion.

Large text, exactly

"Large" means at least 18 point, or 14 point bold. CSS pixels are 0.75 of a point, so that is 24 px, or 18.67 px at weight 700. Semi-bold (600) does not count, even though its name contains "bold": a 20 px semi-bold heading needs the full 4.5:1. This is the most common way a design passes a checker and fails an audit.

Why this page never rounds up

The thresholds are hard limits. A ratio of 4.499:1 fails 1.4.3, so the ratio here is cut to two decimals, never rounded: #777777 on white is 4.47:1, a fail, while #767676 is 4.54:1, the lightest grey that passes. A checker that rounds shows the first as 4.5:1, which reads as a pass.

Translucent text

Text at 60 % opacity is not its own colour; it is a mix of its colour and whatever is behind it. The page blends the two the way a browser does and measures the result, shown as text as rendered. That is the colour an eyedropper would pick up on screen, so it is what an auditor will measure. A translucent background is laid over white first, since the page cannot know what sits behind it.

The suggested fix

When a pair fails, the page keeps the text colour's hue and saturation and moves only its lightness, darker or lighter, to the nearest value that passes, and checks the suggestion after rounding to a hex code. Some backgrounds cannot reach 7:1 with any text colour: on a mid-grey like #777777 even black text gets only 4.68:1, and white 4.47:1. Then the background has to change, and the page says so.

For a whole design-system palette, the palette contrast checker runs this test on every pair at once, from a pasted list of CSS tokens, and names any colour that cannot carry body text with anything else in the palette. To build the palette in the first place, the accessible color palette generator spaces each shade by contrast, so any two steps 500 apart pass 4.5:1.

FAQ

Does 1.4.11 apply to text inside a button?

No. Text is always 1.4.3. 1.4.11 covers the button's boundary when that boundary is the only thing showing it is a button. A filled button whose fill already has 3:1 against the page needs no outline. How large the button has to be is a separate criterion, 2.5.8, which the target size checker measures.

Are disabled controls and logos exempt?

Yes. Text in an inactive control, pure decoration, and text in a logo or brand name have no contrast requirement under 1.4.3. Placeholder text is not exempt.

Does a pair that passes also work for colour-blind readers?

Mostly, because contrast is a matter of lightness and colour blindness changes hue far more than lightness. Protan vision is the exception: reds look darker to it, so red text that only just passes reads weaker. And if the colour itself carries meaning, a separate criterion applies, 1.4.1 Use of Color; the color blindness simulator shows a palette or a screenshot as each type sees it.

What about APCA and WCAG 3?

APCA is a candidate method for the WCAG 3 draft and is not part of any published standard. WCAG 2.2 and EN 301 549 use the ratio on this page, and that is what conformance is judged on today.