Skip to content
hateitall

Contrast Checker

Find out in one glance whether your text colour is readable on its background, and get the nearest colour that passes.

Processed locallyIn: Colour, HEX, CSS colourOut: Contrast ratio, Pass or fail

Loading tool…

How to use contrast checker

  1. Enter the text colour and the background colour, in HEX or any CSS colour syntax.

  2. Read the contrast ratio and the pass or fail result for each WCAG level.

  3. Check the live sample, which shows large text, body text, small print and an outline at those colours.

  4. If it fails, press Use next to a suggested colour to adopt the closest passing one.

What this tool does

  • Computes WCAG 2 relative luminance and the (L1 + 0.05) / (L2 + 0.05) ratio exactly, and shows it truncated so 4.49 never rounds up to a pass.
  • Reports AA and AAA for normal and large text (criteria 1.4.3 and 1.4.6) and the 3:1 rule for UI parts and graphics (1.4.11).
  • Suggests the nearest passing text colour by changing OKLCH lightness only, so hue and character stay the same.
  • Flattens translucent colours the way a browser draws them before measuring.
  • Shows the APCA lightness contrast value, clearly labelled as a draft method.

How the result is verified

You can confirm the maths with known pairs: black on white gives exactly 21:1, and #767676 on white gives 4.54:1, the lightest grey that passes AA for body text.

Frequently asked questions

What counts as large text?

WCAG treats text as large from 24 px regular or 18.66 px bold (18 pt and 14 pt). Large text only needs 3:1 for AA and 4.5:1 for AAA, because bigger letters stay readable at lower contrast.

Why do APCA and WCAG disagree?

WCAG 2 uses a simple luminance ratio that overrates some dark pairs and underrates some light ones. APCA models perceived lightness and treats dark text on light and light text on dark differently. Until WCAG 3 is final, WCAG 2 is the one that counts for compliance.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

HEX, RGB, HSL, OKLCH, OKLab, Lab and P3 with gamut warnings

Colour · HEX · CSS colour→ HEXLight on device

50 to 950 scales, harmonies and tints from one colour

Colour · HEX · CSS colour→ CSSLight on device

Simulate a palette for four colour blindness types and flag clashing pairs

Colour list · HEX · CSS colour→ Simulated paletteLight on device

Pair heading and body fonts from your device, with CSS

Font · TTF · OTF +→ CSSLight on device