Color Contrast Checker
Check the WCAG contrast ratio between two colours, with the AA and AAA thresholds for text.
What this page computes
Pick a text colour and a background colour and the page prints their contrast ratio. Each sRGB channel is linearised — divided by 12.92 below 0.03928, otherwise raised to the power 2.4 after the 0.055 offset — then combined as 0.2126 R + 0.7152 G + 0.0722 B to give relative luminance, and the ratio is (L1 + 0.05) / (L2 + 0.05). Black on white reads 21:1, the maximum the formula allows.
Where it stops
The four verdicts are the WCAG 2.x thresholds for normal and large text: 4.5 and 3 for AA, 7 and 4.5 for AAA. The page reports the number and the pass or fail at each threshold; it does not know your font size, weight or whether the text is decorative, so it cannot decide whether your page is compliant. It does not simulate colour blindness, and it ignores translucency, gradients and anti-aliasing.
The two colours are converted in this tab. Nothing is uploaded, nothing is stored, and the same pair always prints the same ratio.
Black on white reads 21:1, the maximum the WCAG formula allows: each sRGB channel is linearised, combined as 0.2126 R + 0.7152 G + 0.0722 B, and the ratio is (L1 + 0.05) / (L2 + 0.05).
The four verdicts are the AA and AAA thresholds for normal and large text; the page does not know your font size, so it cannot decide whether a page is compliant.
How to use it
Set the text colour and the background colour and press Run. The order does not matter for the ratio — the lighter colour always goes on top — and both codes are restated so a swapped input is visible.
The arithmetic
Each channel is divided by 255 and linearised: below 0.03928 it is divided by 12.92, otherwise 0.055 is added, the sum divided by 1.055 and raised to the power 2.4. Relative luminance weights those channels 0.2126, 0.7152 and 0.0722, and the ratio adds 0.05 to both luminances before dividing.
Where it stops
The thresholds are 4.5 and 3 for AA, 7 and 4.5 for AAA, applied to normal and large text respectively. The page knows nothing about the rendered font, so a passing pair can still be unreadable at a small size and a failing pair can be fine as decoration.
What to Expect
Best for
- Black on white reads 21:1, the maximum the WCAG formula allows: each sRGB channel is linearised, combined as 0.2126 R + 0.7152 G + 0.0722 B, and the ratio is (L1 + 0.05) / (L2 + 0.05).
- Seeing the result before copying it.
What this tool keeps
- The colour you pick is converted in the browser and never posted, so the page works offline and retains nothing.
Sample input
#000000 on #ffffff
Sample output
21:1 foreground #000000 on background #ffffff AA normal 4.5:1 pass · AA large 3:1 pass · AAA normal 7:1 pass · AAA large 4.5:1 pass
Frequently asked questions
How do I use it?
Pick a text colour and a background colour, then press Run. The ratio is printed first, the two colours on the second line and the four threshold verdicts on the third.
Is anything uploaded?
No. The colour is converted in this tab with JavaScript: no request is made, no account is needed, nothing is stored, and the page keeps working offline once loaded.
What are its limits?
The page reports a number and four pass or fail verdicts; it must not be read as a compliance certificate, because font size, weight and meaning are outside it. Translucency, gradients and colour-blindness simulation are not modelled.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.