DevTools Logo

Color Contrast Checker

Color Contrast Checker

Check a text/background pair against WCAG 2.x AA and AAA contrast thresholds.

Runs in your browser
Try an example

Colors

5.47:1 · normal text

Closest: white

Alpha colors are composited before measuring. Hex, rgba() and CSS names are accepted.

Contrast result

5.47:1 · AA pass · AAA fail
5.47:1

Contrast ratio

AA pass · 4.5:1AAA fail · 7:1
The quick brown fox jumps over the lazy dog

About this tool

The Color Contrast Checker measures the ratio between a text color and its background and reports pass or fail against WCAG AA and AAA thresholds. Enter both colors with the hex inputs or pickers, and the ratio — from 1:1 for identical colors up to 21:1 for black on white — updates alongside level badges and a live sample paragraph rendered in the actual pair.

The maths is the WCAG relative-luminance method: each sRGB channel is linearized, weighted 0.2126, 0.7152 and 0.0722, and the lighter luminance plus 0.05 is divided by the darker plus 0.05. One ratio drives every verdict; the size context you select (normal, large, or UI components) only decides which thresholds apply.

Because the ratio compares luminance, it can approve pairs that look muddy to real eyes. WCAG 3's draft APCA model replaces it with perceptual Lc values — try the APCA Contrast Calculator when you need the newer metric — and the built-in protanopia, deuteranopia and tritanopia previews show how the pair survives deficient vision.

How to use this tool

  1. Choose both colors

    Type a hex value or use a picker for foreground and background; the nearest named color is shown.

  2. Set the size context

    Select normal text, large text, or UI components so the right thresholds apply.

  3. Read the verdict

    Weigh the ratio against the AA and AAA badges and the rendered sample text.

  4. Refine or export

    Swap the colors, try a random pair, then copy the analysis or export it as JSON.

WCAG thresholds this checker applies

Content typeAA / AAA minimum
Normal text (below 18pt, or 14pt bold)4.5:1 / 7:1
Large text (18pt+, or 14pt bold+)3:1 / 4.5:1
UI components and graphical objects3:1 / 4.5:1

Success criteria 1.4.3 and 1.4.11; the UI Components preset follows the 3:1 non-text minimum.

Frequently asked questions

What contrast ratio does WCAG AA require?

Level AA needs 4.5:1 for normal text and 3:1 for large text; the same 3:1 minimum covers UI components and graphical-object boundaries under criterion 1.4.11.

What counts as large text?

At least 18pt (24px), or 14pt — about 18.7px — when bold. Anything smaller is judged against the stricter normal-text ratios.

Is APCA replacing the WCAG contrast ratio?

Not yet. APCA is the proposed method for WCAG 3, which remains a draft, while WCAG 2.2 keeps the luminance ratio this tool computes. Check both when a design sits near a threshold.

Do logos need to meet contrast requirements?

No. WCAG exempts logotypes from its text-contrast criteria, along with purely decorative or inactive elements. Text inside a logo image is likewise exempt, though keeping wordmarks legible is still good practice.