WCAG Contrast Checker
Check the contrast ratio of text and background against WCAG 2.2 AA and AAA, with a suggested fix. Works with hex, rgb, hsl, oklch and transparency.
The quick brown fox jumps over the lazy dog
Contrast ratio
| Level | AA | AAA |
|---|---|---|
| Normal text | ||
| Large text | ||
| UI components | – |
Closest passing text color:
Resolved colors: · APCA Lc (WCAG 3 draft, for information):
At a glance
- Processing
- Locally in your browser, also offline once the page has been opened. Input never leaves your device.
- Standard
- WCAG 2.2 contrast ratio; the APCA value is shown as a draft for WCAG 3
- Colors
- Hex, rgb, hsl, oklch, Display-P3 and names; transparency is composited, colors outside sRGB are clamped and flagged
- For agents
-
WebMCP:
contrast_check· Module:/core/contrast-checker.js· Markdown · llms-full.txt
How to Use
- 01 Enter two colors Type or pick the text color and the background color. Any CSS color works, for example #1a1a1a, oklch(0.6 0.15 250) or rebeccapurple.
- 02 Set the text size Enter font size and weight. Large text needs a lower ratio, so the verdict depends on size.
- 03 Read the verdict See the ratio, which levels pass and, if AA fails, the closest foreground color that passes.
About this tool
Low contrast is one of the most common accessibility failures. WCAG measures it as the ratio of the relative luminance of two colors, from 1:1 (identical) to 21:1 (black on white).
The suggestion keeps hue and chroma and changes only the lightness in OKLCH, so the fixed color still looks like yours.
Frequently Asked Questions
AA needs 4.5:1 for normal text and 3:1 for large text and interface components. AAA needs 7:1 for normal and 4.5:1 for large text.
Text of at least 24 px (18 pt), or at least 18.66 px (14 pt) in bold. Everything smaller is normal text.
WCAG gives no rounding. The verdict uses the exact value, and the display never shows a failing value as reaching the threshold.
A translucent text color is blended over the background. A translucent background is assumed to sit on white, and the tool says so.
APCA is the contrast method proposed for WCAG 3. Its Lc value is shown for information only; WCAG 2.2 conformance is decided by the ratio.