WCAG Contrast Checker
Calculate WCAG 2.x text and interface contrast from two opaque colors, with exact thresholds and JSON export.
Two colors. A measurable difference.
IN YOUR BROWSER / PRIVATE INPUTHow to use the
WCAG Contrast Checker
- 01
Choose the actual foreground
Set the opaque text or interface color used in your design.
- 02
Choose the actual background
Use the surface directly behind it; gradients and images need separate sampling.
- 03
Read the exact ratio and thresholds
Review AA/AAA normal and large-text checks. Download the numerical evidence; color checks alone do not certify a page.
Relative luminance, then a contrast ratio
ratio = (lighter luminance + 0.05) / (darker luminance + 0.05)Each six-digit sRGB channel is linearized at the 0.04045 boundary. Relative luminance weights red 0.2126, green 0.7152 and blue 0.0722. The unrounded ratio determines every pass condition.
Which WCAG threshold applies?
Logotypes, inactive controls and incidental content have specific exceptions. Confirm the applicable success criterion instead of applying every row to every element.
| Use | AA | AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text: 18 pt regular or 14 pt bold | 3:1 | 4.5:1 |
| Relevant non-text interface indicators | 3:1 | Not a separate AAA threshold |
Black and white establish the endpoints
Foreground #000000
Background #ffffff21:1
AA and AAA normal text passTest the rendered states
Inspect hover and focus
A passing default color does not validate focus outlines, disabled states or links.
Avoid rounded boundary decisions
A displayed 4.50 may be a rounded value below the actual 4.5 threshold. The tool uses the full ratio.
Sample image and gradient backgrounds
This tool accepts two opaque colors. Use the worst visible background color behind text when reviewing a variable surface.
WCAG Contrast Checker:
questions, answered.
Does this WCAG checker certify an accessible website?
No. It calculates two-color contrast. Keyboard use, semantics, focus, alternative text and other success criteria need separate checks.
Can I test transparent text or a gradient here?
The inputs are opaque six-digit colors. First composite transparency against its real background and sample relevant gradient or image areas.
Why does large text use a lower contrast threshold?
WCAG treats text at least 18 pt regular or 14 pt bold as large. Confirm the actual rendered size and weight before using that threshold.
Does rounding affect a WCAG pass?
The calculation compares the full unrounded ratio against each threshold. The shortened display is for readability only.
The calculations and checks above describe this tool's implementation. Use these primary references for the underlying formats and publishing guidance.
WCAG contrast minimum ↗ (opens in a new tab)WCAG non-text contrast ↗ (opens in a new tab)Put WCAG Contrast Checker to work.
Calculate WCAG 2.x text and interface contrast from two opaque colors, with exact thresholds and JSON export.
Use the WCAG Contrast Checker↑