Color · Accessibility

Contrast checker.

Pick a text color and a background color and get the exact WCAG contrast ratio, with pass/fail against AA and AAA for normal text, large text, and UI components.

Advertisement

Colors

Result

Normal text sample (15px) — AaBbCc

Large text sample (24px)

21.00:1
Advertisement

Read the result against the thing you are designing

A contrast ratio is a property of two colours, but the pass condition depends on how those colours are used. Normal text needs 4.5:1 for WCAG 2.2 Level AA. Large text needs 3:1. Level AAA raises those thresholds to 7:1 and 4.5:1. Visual information needed to identify a user-interface component or graphical object generally needs 3:1 against adjacent colours.

The tool converts each sRGB colour to relative luminance, then divides the lighter adjusted luminance by the darker one: (L1 + 0.05) / (L2 + 0.05). Swapping foreground and background does not change the ratio. It can change the reading experience, especially for thin type, but WCAG's ratio is symmetric.

Worked example: dark slate on white

The default pair is #111827 text on #FFFFFF. It produces about 17.74:1. That passes AA and AAA for both normal and large text, and it clears the 3:1 non-text threshold. If that same text is rendered at reduced opacity over a photograph, this result no longer describes the final pixels. Sample the composited colours or test the rendered component.

What this checker can and cannot certify

Use it to check solid foreground and background colours in a design system, stylesheet or mock-up. It does not inspect font size, font weight, hover and focus states, gradients, background images, transparency or anti-aliasing. A passing pair is one accessibility requirement, not a WCAG conformance statement.

Colour alone can also fail to communicate a state even when the ratio passes. Pair error red with text or an icon, and inspect red-green distinctions in the colour-vision simulator. For a second perceptual view during design, compare the result with the APCA contrast checker. APCA numbers are not substitutes for current WCAG 2.2 thresholds.

The checker calculates the two hex values in your browser. It does not need a server request or an account to calculate the ratio.

Primary sources and review date

Thresholds and definitions come from W3C's WCAG 2.2: 1.4.3 Contrast (Minimum), 1.4.6 Contrast (Enhanced), 1.4.11 Non-text Contrast, and the contrast-ratio definition. Reviewed 17 November 2026.

Frequently asked questions

What contrast ratio does normal text need for WCAG AA?

WCAG 2.2 Success Criterion 1.4.3 requires at least 4.5:1 for normal text, apart from listed exceptions such as logos and incidental text.

What counts as large text for the lower 3:1 threshold?

WCAG defines large-scale text as at least 18 point, or 14 point when bold. In CSS reference pixels that is about 24 px, or about 18.7 px bold.

Do buttons and form borders need 4.5:1 contrast?

Their text follows the text thresholds. The visual information needed to identify a component or state generally needs 3:1 against adjacent colours under WCAG 2.2 Success Criterion 1.4.11.

Does passing this checker make a page WCAG compliant?

No. This checker evaluates one pair of opaque sRGB colours. WCAG conformance also depends on focus states, images, text size and weight, interactions, semantics, keyboard use and many other requirements.

Why does a colour pair pass here but look different in a screenshot?

A screenshot may include opacity, anti-aliasing, gradients, shadows, colour profiles or a background image. Test the final rendered foreground and background colours, not only the design-token values.

Should I use APCA or the WCAG 2.2 ratio?

Use the WCAG 2.2 ratio for current WCAG 2 conformance checks. APCA is a different perceptual model that can be useful during design exploration, but its values and thresholds are not interchangeable with WCAG 2.2.

Advertisement