Contrast Checker
Enter a text color and a background color to see their contrast ratio and whether they pass WCAG 2.2 at levels AA and AAA.
Large text: 24px
Large bold text: 19px
Normal text at 16px. The quick brown fox jumps over the lazy dog.
ButtonContrast ratio
14.49:1
- PassAA, normal text ≥ 4.5:1 · SC 1.4.3
- PassAA, large text ≥ 3:1 · SC 1.4.3
- PassAAA, normal text ≥ 7:1 · SC 1.4.6
- PassAAA, large text ≥ 4.5:1 · SC 1.4.6
- PassUI components and graphics ≥ 3:1 · SC 1.4.11
Check a whole palette
Rows are text colors, columns are backgrounds. Tap a cell to check that pair above.
| Text colorText ↓ / Bg → | #22252a | #faf8f4 | #e2553f | #2f6b55 | #cfe8dc |
|---|---|---|---|---|---|
| #22252a | — | ||||
| #faf8f4 | — | ||||
| #e2553f | — | ||||
| #2f6b55 | — | ||||
| #cfe8dc | — |
How to use
- Pick or type the text color and the background color as HEX codes (3 or 6 digits).
- Read the contrast ratio and the pass or fail result for each WCAG level. The preview shows normal and large text in your colors.
- If normal text fails AA, the tool suggests the closest text color that passes, keeping the same hue. Press Use it to try it.
- Press Swap to check light text on a dark background the other way around. Copy link copies the page address with both colors in it, so a teammate opens the same check.
- To test a whole palette, paste 2 to 8 hex colors into Check a whole palette. Every color is tried as text on every other color; tap a cell to load that pair into the checker above.
How it works
WCAG 2.2 measures contrast with the relative luminance of each color: how bright it looks, from 0 for black to 1 for white. Each sRGB channel (0–255) is divided by 255 and converted to linear light, then weighted by how sensitive the eye is to red, green and blue:
The ratio runs from 1:1 (two identical colors) to 21:1 (black on white). It is then compared with these minimums:
| Level | Normal text | Large text | UI components and graphics |
|---|---|---|---|
| AA | 4.5:1 (SC 1.4.3) | 3:1 (SC 1.4.3) | 3:1 (SC 1.4.11) |
| AAA | 7:1 (SC 1.4.6) | 4.5:1 (SC 1.4.6) | — |
The comparison uses the full, unrounded ratio. The ratio on screen is cut (not rounded) to two decimals, so it can never look like a pass when it isn't.
The palette matrix
For a palette of n colors, the matrix runs the same formula for every ordered pair, n × (n − 1) checks, and labels each cell with the highest level it reaches for normal text: AAA (7:1), AA (4.5:1), "AA large" (3:1, enough for large text and UI parts only) or Fail. Because the ratio doesn't depend on order, each pair appears twice with the same number, once in each direction, so you can read the table by text color or by background.
Worked example
#767676 on white. White has luminance 1.0000. Gray #767676 has channels of 118, which linearize to a luminance of 0.1812.
Ratio = (1.0000 + 0.05) / (0.1812 + 0.05) = 4.54:1, so it passes AA for normal text.
#777777 on white, one step lighter: luminance 0.1845, ratio 4.47:1. That fails AA for normal text but passes for large text.
A five-color palette (#22252a, #faf8f4, #e2553f, #2f6b55, #cfe8dc) gives 20 text-on-background pairs, and 8 of them reach AA for normal text. Tomato on the off-white background is 3.53:1 (AA large), while off-white text on the deep green is 5.90:1 (AA).
Tomato #e2553f on white gives 3.74:1, which fails AA for normal text. The nearest passing text color with the same hue is #db3a21 at 4.52:1.
Limits
- The ratio is for two solid colors. Text over images, gradients or semi-transparent layers needs checking at the lowest-contrast spot, which this tool can't see.
- WCAG's formula doesn't model how thin fonts, small sizes or anti-aliasing look. A pass for a very thin font can still be hard to read.
- Passing contrast is one requirement among many. It doesn't make a page accessible on its own (for example, color alone must not carry meaning).
- Logos and incidental or disabled text are exempt from WCAG contrast rules; the tool doesn't know what your text is used for.
- The suggested color only changes lightness. It is the nearest pass by that measure, not necessarily the best-looking choice.
- Your last pair is saved in this browser only (local storage) so it is there next time; a shared link always takes priority over the saved pair.
FAQ
What contrast ratio do I need for WCAG AA?
At least 4.5:1 for normal text and 3:1 for large text (SC 1.4.3). Buttons, input borders, icons and other graphics that people need to see need at least 3:1 against what is next to them (SC 1.4.11).
What counts as large text?
WCAG defines large text as at least 18 point, or 14 point when bold. On the web that is roughly 24 CSS pixels, or about 18.66 pixels bold.
Why does 4.49:1 fail when it is so close to 4.5?
WCAG thresholds are exact minimums, and the W3C notes that values should not be rounded up to meet them. This tool compares the unrounded ratio and shows it cut to two decimals, so a ratio of 4.499 shows as 4.49 and fails AA.
Does the order of the two colors matter?
No. The formula always divides the lighter color's luminance by the darker one's, so swapping text and background gives the same ratio. The Swap button is there so the preview matches your design.
How do I check every combination in my color palette?
Paste your palette into the matrix below the checker. Each row is a text color and each column a background, so you can see at a glance which pairs reach AA (4.5:1) or AAA (7:1) and which only work for large text.
Is the AAA level required?
Most laws and policies point to WCAG level AA. AAA (7:1 for normal text, 4.5:1 for large) is stricter, and the W3C does not recommend requiring it for entire sites, but meeting it helps people with low vision.