Color Contrast Checker
Enter a foreground colour and a background colour to get the WCAG 2.1 contrast ratio, Pass/Fail verdicts for AA/AAA normal and large text plus graphics, and an APCA Lc luminance approximation.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
Give it two colours, get a verdict
Type the foreground colour into the main box and the background colour into the background option. Both accept six-digit or three-digit hex, an rgb() or rgba() function with plain or percentage channels, or about thirty common CSS colour names. The result table prints the WCAG 2.1 contrast ratio and Pass or Fail for AA and AAA at both normal and large text sizes, plus figures for interface graphics.
When to reach for it
Run it while picking a palette for a form label, a button or body copy on a card background, to see whether a combination clears 4.5 to 1 before anyone ships it. Because the check is instant, you can nudge a grey a shade darker and watch the ratio jump without leaving the page.
Reading the APCA line
The final row adds an APCA Lc approximately: a signed number, positive for dark text on a light background and negative the other way, where larger magnitudes mean more perceived contrast. It is a quick perceptual sanity check beside the WCAG ratio, not a replacement, and the interface labels it approximate because it is not the full published algorithm.
Caveats
The ratio is computed from the two flat colours you supply, so it ignores transparency and gradients, and passing a ratio never guarantees legibility at tiny sizes or on textured backgrounds. Anything the parser cannot read raises an error naming the offending value. The calculation touches nothing but your own input and runs entirely on-device, so the colours you are testing stay private.
Questions
What is the APCA value?
APCA (Accessible Perceptual Contrast Algorithm,) the successor to WCAG contrast, estimates perceived contrast in Lc units. This is an approximation off the full APCA 0.0.98G algorithm, labelled "approx".
Which colour formats can I type?
Hex in three or six digits (with or without the leading #), rgb() or rgba() functions whose channels may be plain numbers or percentages, and around thirty common CSS names such as black, white, navy, crimson, coral and khaki. Anything else raises an error naming the value it could not read.
What ratios do AA and AAA need?
WCAG 2.1 asks for 4.5 to 1 for normal AA text and 3 to 1 for large AA text; AAA raises these to 7 to 1 and 4.5 to 1. Non-text interface components and graphics need 3 to 1 under AA, which is the graphics row in the table.
Does the checker account for opacity or gradients?
No. It measures the two flat colours you provide, so a semi-transparent text colour or a gradient background must be flattened to a single colour for the result to be meaningful.
Related tools
See categoryColour Converter
Convert a colour between HEX, RGB, HSL, HSV, CMYK and OKLCH.
Color Palette Generator
Generate tints, shades, complementary, triadic and analogous color palettes.
Color Name Finder
Find the nearest of the 148 CSS named colors, ranked by perceptual distance.
Color Blender
Mix two colors in RGB or HSL space with a 0-100% blend ratio.