Clever Quest Lab Tools

Color Contrast Checker

Check whether a text colour and a background colour meet WCAG 2.x contrast requirements. Pick or type two colours and see the exact ratio, pass/fail badges for every WCAG level, and a live preview of how the pair actually looks.

4.54:1 contrast ratio
  • AA · Normal text (4.5:1)
  • AA · Large text (3:1)
  • AAA · Normal text (7:1)
  • AAA · Large text (4.5:1)
  • UI components & graphics (3:1)

Live preview

Normal text (16px) — the quick brown fox jumps over the lazy dog.

Large text, 24px regular

Large text, 18.66px bold

Nothing you type or record is uploaded.

Runs on your device. Nothing you type or record is uploaded. Keeps working without a connection while the page is open. Works with touch. Nothing is saved; reloading resets both colours.

Added

How to use the Color Contrast Checker

  1. Pick or type the text colour using the swatch or hex field under "Text color".
  2. Pick or type the background colour the same way under "Background color".
  3. Read the big contrast ratio and the five pass/fail badges underneath. Each badge is a different WCAG requirement, explained in the table below.
  4. Check the live preview to see normal text, large text, a button and an input border rendered in the colours you chose.
  5. If "AA · Normal text" fails, a suggestion box offers the closest passing shade of your text colour (same hue); click "Use this color" to apply it.
  6. Use "Swap" to test the pair in reverse, or "Reset" for the starting colours.

How the contrast ratio is calculated

The checker uses the formula from WCAG 2.x Success Criterion 1.4.3 (Contrast (Minimum)) and 1.4.11 (Non-text Contrast). Each colour's three 8-bit channels (0–255) are converted to the 0–1 range and "linearized" to undo sRGB gamma encoding:

csrgb = channel ÷ 255

If csrgb ≤ 0.04045, the linear value is csrgb ÷ 12.92; otherwise it is ((csrgb + 0.055) ÷ 1.055)2.4. Those linear red, green and blue values are then combined into a single relative luminance using weights that match how sensitive human vision is to each channel:

L = 0.2126 × R + 0.7152 × G + 0.0722 × B

Finally, the contrast ratio between the lighter colour's luminance (L1) and the darker colour's luminance (L2) is:

ratio = (L1 + 0.05) ÷ (L2 + 0.05)

Before May 2021 the WCAG definition used 0.03928 instead of 0.04045 for that threshold. No 8-bit channel value lies between the two (10/255 is about 0.0392 and 11/255 about 0.0431), so for hex colours both give the same result; this tool uses the current 0.04045. The ratio ranges from 1:1 (identical colours) to 21:1 (black on white) and depends only on lightness, not hue, which is why two very different-looking colours can still fail if their luminance is too close.

Examples

Black text on a white background

#000000 on #ffffff has luminance 0 and 1, so the ratio is (1 + 0.05) ÷ (0 + 0.05) = 21.00:1. That is the maximum possible contrast, and it passes every level in the table below.

Two nearly identical greys

#777777 on white comes out to 4.48:1, just under the 4.5:1 AA threshold for normal text, so it fails. Darkening it by a single hex step, to #767676, raises the ratio to 4.54:1, which passes. That makes #767676 the lightest neutral grey that passes AA for normal text on white.

A brand blue

This site's own link colour, #2952cc, on a white background computes to 6.62:1. That clears AA for both normal and large text and clears AAA for large text (4.5:1), but falls short of AAA for normal text (7:1).

WCAG contrast levels at a glance

Success criterionApplies toMinimum ratio
1.4.3 Contrast (Minimum), Level AANormal text4.5:1
1.4.3 Contrast (Minimum), Level AALarge text3:1
1.4.6 Contrast (Enhanced), Level AAANormal text7:1
1.4.6 Contrast (Enhanced), Level AAALarge text4.5:1
1.4.11 Non-text Contrast, Level AAUI components & graphical objects3:1

What counts as "large" text

WCAG defines large text as at least 18pt (24px) regular weight, or at least 14pt (about 18.66px) bold weight, at standard browser scaling. Large text gets a lower minimum ratio because thicker, wider strokes stay legible at lower contrast than fine body text.

What's exempt from the contrast requirement

A note on WCAG 3 and APCA

APCA (Accessible Perceptual Contrast Algorithm) is a newer contrast method that takes font size, font weight and perceived brightness into account more closely than the formula above. The first public WCAG 3 draft (January 2021) used it, but the current WCAG 3 Working Draft (10 September 2026) says its contrast algorithm is yet to be determined, and WCAG 3 is not a finished Recommendation. APCA therefore has no pass/fail thresholds you can cite for compliance. Accessibility audits and the standards that laws point to, such as EN 301 549 in the EU (WCAG 2.1 Level AA) and the US Section 508 standards (WCAG 2.0 Level AA), still use the formula above, which is what this tool implements.

Practical tips for designers

Frequently asked questions

What is a good contrast ratio for body text?

Aim for at least 4.5:1 (WCAG AA, Success Criterion 1.4.3) for any normal-sized body text. Reaching 7:1 (AAA) is better for users with low vision, but AA is the level most accessibility audits actually require.

Does this checker work for gradients or photos?

No. It compares two flat colours. For text over a gradient or photo, test against the least favourable point behind the text: the brightest patch if the text is dark, or the darkest patch if the text is light.

Is passing the contrast ratio the same as supporting colour blindness?

No. Contrast ratio only measures lightness difference, not whether two colours are distinguishable to someone with a colour vision deficiency. A red and a green of similar luminance can both pass against the same background yet look alike to a colour-blind user, so never rely on colour alone to convey information (Success Criterion 1.4.1).

Can I use this for buttons and icons, not just text?

Yes. Success Criterion 1.4.11 applies the same 3:1 minimum to the visible boundaries of UI components (borders, outlines, toggle states) and to meaningful graphical objects like icons or chart lines. Enter the component's own colour as "Text color" and whatever it sits on as "Background color".

Sources