Category: Developer tools
Color Contrast Checker
Contrast ratio for one foreground and background pair, checked against AA 4.5:1 and AAA 7:1
Enter a foreground and background colour as HEX, RGB or HSL to get the relative luminance, the contrast ratio and pass or fail at WCAG AA 4.5:1 and AAA 7:1.
Everything on this page is processed in your browser. Nothing is uploaded.
What this tool does
This is a two-colour WCAG contrast checker, and the pair is the whole scope. Enter a foreground and a background colour, either through the pickers or by typing HEX, RGB or HSL. The tool computes the relative luminance of each colour, derives the contrast ratio between them, and previews the foreground text over the chosen background so you can judge the result visually as well as numerically. Pass and fail are reported against two fixed thresholds: AA at 4.5:1 and AAA at 7:1, the normal-text levels. Everything around those two numbers is deliberately absent, and that is worth stating plainly because almost every competing page bundles it. There is no separate large-text row, no non-text or UI-component contrast at 3:1, no focus-indicator evaluation and no APCA or WCAG 3.0 mode. There is no whole-page or site-wide audit and no automatic colour correction, so the tool will never propose a passing substitute for a colour you chose. There is no eyedropper, no image upload and no alpha compositing, so semi-transparent colours have to be flattened before you test them. And one thing deserves to be said directly: a pair that passes 4.5:1 or 7:1 tells you about that pair, not about the accessibility conformance of the whole page. Entered colours and calculated results stay in your browser and are never uploaded to LocalTools.
How to use it
- Set the foreground and background colours with the pickers or by typing HEX, RGB or HSL values.
- The relative luminance of each colour is calculated and turned into the contrast ratio, with a live preview of text on the background.
- Read the AA 4.5:1 and AAA 7:1 results and adjust the pair; no other threshold is scored here.
Privacy
This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.
Frequently asked questions
- What contrast ratio is required for WCAG AA?
- Normal body text needs at least 4.5:1 against its background. That is one of the two thresholds reported here, shown as a straight pass or fail for the pair you entered.
- What contrast ratio is required for WCAG AAA?
- AAA raises the bar for normal text to 7:1. The tool reports that threshold alongside AA, so you can see immediately whether a pair clears the stricter level.
- What is the difference between WCAG AA and AAA colour contrast?
- They are two conformance levels for the same measurement. AA is the commonly required minimum at 4.5:1 for body text, AAA is the enhanced level at 7:1. This tool scores both and nothing else.
- How is the contrast ratio calculated?
- Each colour is converted to its relative luminance, then the lighter and darker values are compared as (L1 + 0.05) / (L2 + 0.05). The result is the n:1 ratio shown on the page.
- Is a passing ratio a full accessibility audit?
- No. It covers one foreground and background pair. Large text, non-text UI components, focus indicators, APCA and whole-page scanning are not evaluated here, and passing 4.5:1 or 7:1 is not a conformance claim for a page.