UTILS.
Private by default
◐

Color Contrast Checker

Check the WCAG contrast ratio between a text and background color with AA/AAA results.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
The quick brown fox jumps over the lazy dog.
Large sample text

Try a worked example

Example

Set the text color to #767676 and the background to #ffffff. The ratio is 4.54:1, which passes AA for normal text. One shade lighter, #777777 gives 4.48:1 and fails, because AA needs at least 4.5:1 for normal text.

Keep in mind

Large text (about 24px, or 18.7px bold) needs only 3:1 for AA. The ratio ignores thin fonts, text over images and transparency, so check the real design as well, and do not rely on color alone to show meaning.

About this tool

Compare a foreground and background color to see the WCAG contrast ratio and whether it passes AA and AAA, all computed locally in your browser.

Both colors come from the browser's color pickers, so they are opaque hex colors with no alpha. Each channel is converted to linear light, luminance uses weights 0.2126, 0.7152 and 0.0722, and the ratio is the lighter luminance plus 0.05 over the darker plus 0.05.

The ratio is shown to two decimals, but if rounding would reach 3, 4.5 or 7 while the true value is just below, it is truncated, so 4.499:1 is not shown as 4.50:1 beside a Fail. The tiles test 4.5 (AA normal), 7 (AAA normal), 3 (AA large) and 4.5 (AAA large).

Frequently asked questions

What counts as large text?
WCAG treats text at 18pt (24px) or 14pt (18.66px) bold as large, which needs a lower ratio of 3:1 for AA.
Which ratios pass?
Normal text needs 4.5:1 for AA and 7:1 for AAA; large text needs 3:1 for AA and 4.5:1 for AAA.
Does the order of the two colors matter?
No. The larger luminance is always divided by the smaller, so swapping them gives the same ratio.
Can I check a semi-transparent color?
No. The pickers give opaque colors only.

More tools