Contrast Checker

  • Runs in your browser
  • Nothing uploaded
  • No sign-up
Input

Any HEX, rgb(), hsl() or oklch(). Alpha is composited over the background.

Contrast ratio

4.54 : 1

  • Normal text · AA · SC 1.4.34.5:1Pass
  • Normal text · AAA · SC 1.4.67:1Fail
  • Large text · AA · SC 1.4.33:1Pass
  • Large text · AAA · SC 1.4.64.5:1Pass
  • UI components & graphics · AA · SC 1.4.113:1Pass
Nearest passing text colour

Same hue and chroma, lightness moved just far enough.

  • #5959597.00:1 · reaches 7:1 (AAA)

contrast = (L1 + 0.05) / (L2 + 0.05) · L = 0.2126 R + 0.7152 G + 0.0722 B, each channel linearised (≤ 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055)^2.4)

Large text is at least 18pt (about 24px) regular or 14pt (about 18.5px) bold. Logos and purely decorative text have no contrast requirement.

Updated · DRISH LABS

How do you check color contrast for WCAG?

WCAG 2.2 asks for a contrast ratio of 4.5:1 for normal text and 3:1 for large text at level AA, 7:1 and 4.5:1 at AAA, and 3:1 for user-interface components and meaningful graphics. The ratio compares the relative luminance of the two colours and runs from 1:1 for identical colours to 21:1 for black on white. The thresholds are not rounded: 4.499:1 does not meet 4.5:1.

How it works

  1. Enter a text colour and a background in any common form — hex, rgb(), hsl() or oklch() — or pick them. A preview shows the pair as large text, body text and a button outline.
  2. The contrast ratio is computed from each colour’s relative luminance exactly as WCAG 2.2 defines it, and shown truncated rather than rounded, so a ratio of 4.499 can never display as 4.50 beside a fail.
  3. Five verdicts follow: normal text at AA (4.5:1) and AAA (7:1), large text at AA (3:1) and AAA (4.5:1), and user-interface components and graphics at 3:1. Each is a pass or a fail in words, not only in colour.
  4. If the text colour falls short, the nearest colour that passes is suggested for AA and for AAA — the same hue and chroma, with only the lightness moved just far enough — ready to use or copy.
  5. A translucent text colour is measured as it is painted: blended over the background first. Everything runs in the page.

How the contrast ratio is calculated

Each colour’s channels are divided by 255 and linearised: a value at or below 0.04045 is divided by 12.92, anything above is ((c + 0.055) / 1.055) raised to 2.4. Relative luminance weights the three by how bright the eye finds them — green most, blue least. The ratio is the lighter luminance plus 0.05 over the darker plus 0.05, so it runs from 1:1 (identical) to 21:1 (black on white). The 0.05 stands in for the light a screen reflects, which keeps very dark pairs from scoring impossibly high.

L = 0.2126 R + 0.7152 G + 0.0722 B · contrast = (L_lighter + 0.05) / (L_darker + 0.05)

When you need it

Checking body text before it ships
Grey text on white is the most common contrast failure on the web. #767676 is the lightest grey that passes 4.5:1 on white; anything lighter fails AA for body copy.
Fixing a brand colour that fails
When a brand colour is too light for text, the suggested fix keeps its hue and chroma and only darkens it — the same colour family, just readable — rather than swapping it for an unrelated grey.
Buttons, inputs and icons
WCAG asks 3:1 of the visual parts of a control that identify it — a field’s border, a toggle’s state, an icon that carries meaning — against the colours next to it. Check the outline colour against its background with the UI line.
Dark mode
Contrast has to be checked again in dark mode: light text on a dark ground behaves differently, and a grey that passed on white can fail on near-black. Swap the pair and check both schemes.
Translucent text
Text set with opacity — rgb(0 0 0 / 0.6) — is blended with whatever is behind it. Enter it with its alpha and the background, and the ratio is measured on the colour that is actually painted.

Questions

What contrast ratio does WCAG require?

At level AA, 4.5:1 for normal text and 3:1 for large text (SC 1.4.3), and 3:1 for user-interface components and meaningful graphics (SC 1.4.11). At level AAA, 7:1 for normal text and 4.5:1 for large text (SC 1.4.6).

What counts as large text?

At least 18 point, or 14 point bold. WCAG’s Understanding document puts that at about 24px and 18.5px in CSS (1pt = 1.333px). Anything smaller is normal text.

Can I round 4.47:1 up to 4.5:1?

No. WCAG’s Understanding document says the thresholds are not rounded — even 4.499:1 does not meet 4.5:1. This page truncates the displayed ratio for that reason, so it never shows a passing number beside a failing verdict.

Do logos need to meet contrast requirements?

No. Text that is part of a logo or brand name has no contrast requirement, and neither does purely decorative text or text in an inactive control. Interactive elements should still be distinguishable.

Why does this give a slightly different result from another checker?

Older checkers use 0.03928 as the threshold in the luminance formula; WCAG corrected it to 0.04045. The difference is tiny and only shows in a few dark colours. Some checkers also round the ratio, which can turn a fail into an apparent pass.

Does it check APCA?

No. APCA is a proposed method for a future WCAG 3 and is not a conformance requirement today. WCAG 2.2’s ratio is what audits and laws reference, so that is what this measures.

Keep going

All 31 tools