Color contrast checker for WCAG 2.2
Pick a text colour and a background. See the ratio, whether it passes AA and AAA, the closest colours that do, and how it looks with colour-blindness. Free, instant, and nothing leaves your browser.
Your colours
#777777 · rgb(119, 119, 119) · hsl(0, 0%, 47%)
#ffffff · rgb(255, 255, 255) · hsl(0, 0%, 100%)
Try an example
Result
4.48:1
Passes only for large text and UI parts
Contrast ratio 4.48 to 1. Passes only for large text and UI parts.
Large text: book your visit today
Normal text: opening hours, prices and contact details need to be easy to read for everyone, including people on a phone in bright sunlight.
- Fail
AA, normal text
Needs 4.5:1 · Body text and most labels. The level most laws and policies ask for.
- Pass
AA, large text
Needs 3:1 · Text from 24px, or 18.66px and bold.
- Fail
AAA, normal text
Needs 7:1 · The enhanced level. Worth aiming for on long reading.
- Fail
AAA, large text
Needs 4.5:1 · Large text at the enhanced level.
- Pass
Buttons, icons and borders
Needs 3:1 · Parts of controls and graphics you need to see (WCAG 2.2, 1.4.11).
Fix it: the closest colours that pass
Same hue, smallest change. Pick one to try it in the preview above.
Change the text colour
Darker text: #767676
4.54:1 · keeps the same hue, moves less than 1 point of lightness
Or change the background
Darker background: #060606
4.52:1 · keeps the same hue, moves 98 points of lightness
How it looks with colour-blindness
About 1 in 12 men and 1 in 200 women have some form of colour-vision deficiency. These previews are an approximation, and the ratio is measured on the simulated colours.
Aa
Sample text
Protanopia
No red cones. Reds look dark and muddy.
4.48:1Below AAAa
Sample text
Deuteranopia
No green cones. The most common type.
4.48:1Below AAAa
Sample text
Tritanopia
No blue cones. Rare. Blues and yellows blur together.
4.48:1Below AAAa
Sample text
Greyscale
No colour at all. Only lightness is left.
4.48:1Below AA
What the numbers mean
WCAG measures how different two colours are in brightness, on a scale from 1:1 (identical) to 21:1 (black on white). Which number you need depends on what you are colouring.
| Level | Minimum ratio | Applies to |
|---|---|---|
| AA, normal text | 4.5 : 1 | Body text, labels, links, placeholder text and most small text. |
| AA, large text | 3 : 1 | Text from 24px regular, or from 18.66px bold. |
| AAA, normal text | 7 : 1 | The stricter level. Worth aiming for on long articles and for low-vision readers. |
| AAA, large text | 4.5 : 1 | Large text at the stricter level. |
| Buttons, icons, borders | 3 : 1 | The visible edges of inputs and buttons, icons that carry meaning, chart lines and focus rings. |
How the ratio is worked out
Each colour gets a relative luminance, a number from 0 (black) to 1 (white) that weights green most and blue least, because that is how bright they look to the eye. The ratio is then (lighter + 0.05) ÷ (darker + 0.05). The 0.05 stops the maths blowing up near black. This is the formula in WCAG 2.x, so the answer matches the other well-known checkers, with one difference: this tool never rounds a failing result up over a pass mark.
Mistakes we see on real websites
- Light grey text. Placeholders, captions, dates and footers in a pale grey. #777777 on white misses AA by a whisker, while #767676 passes.
- White on a bright button. Orange, yellow, light green and many blues look lively but fail with white text. Darken the button, or use dark text on it.
- Text over photos. Contrast changes from letter to letter. Put a solid or semi-transparent panel behind the words.
- Colour as the only signal. A red error and a green success that differ only in hue disappear for many colour-blind people. Add an icon or a word.
- Forgetting the small parts. Input borders, icons and chart lines need 3:1 too, and so do focus rings.
A scan finds these across a whole site. See the guide to the “color-contrast” error for the exact fix.
Popular colour combinations, checked
Common pairs from design systems and websites, with the real numbers.
- White on black21:1 · Passes AAA
- Black on white21:1 · Passes AAA
- Dark grey #333333 on white12.63:1 · Passes AAA
- Grey #666666 on white5.74:1 · Passes AA
- Grey #767676 on white4.54:1 · Passes AA
- Grey #777777 on white4.48:1 · Passes AA large
- Grey #888888 on white3.54:1 · Passes AA large
- Light grey #999999 on white2.85:1 · Fails
- Light grey #cccccc on white1.61:1 · Fails
- Grey #808080 on black5.32:1 · Passes AA
- White on grey #8080803.95:1 · Passes AA large
- White on Bootstrap 4 blue #007bff3.98:1 · Passes AA large
- White on Bootstrap 5 blue #0d6efd4.5:1 · Passes AA
- White on Tailwind blue-500 #3b82f63.68:1 · Passes AA large
- White on Tailwind blue-600 #2563eb5.17:1 · Passes AA
- Tailwind gray-400 #9ca3af on white2.54:1 · Fails
- Tailwind gray-500 #6b7280 on white4.83:1 · Passes AA
- White on pure blue #0000ff8.59:1 · Passes AAA
- Blue #0000ff on white8.59:1 · Passes AAA
- Blue #0000ff on black2.44:1 · Fails
- White on red #ff00004:1 · Passes AA large
- Red #ff0000 on white4:1 · Passes AA large
- Red #ff0000 on black5.25:1 · Passes AA
- Black on red #ff00005.25:1 · Passes AA
- White on Bootstrap 4 green #28a7453.13:1 · Passes AA large
- White on green #0080005.14:1 · Passes AA
- Green #008000 on white5.14:1 · Passes AA
- Lime #00ff00 on black15.3:1 · Passes AAA
- Lime #00ff00 on white1.37:1 · Fails
- White on orange #ff99002.14:1 · Fails
- Black on orange #ff99009.81:1 · Passes AAA
- Orange #ff9900 on white2.14:1 · Fails
- White on yellow #ffff001.07:1 · Fails
- Black on yellow #ffff0019.56:1 · Passes AAA
- Yellow #ffff00 on black19.56:1 · Passes AAA
- Yellow #ffff00 on blue #0000ff8:1 · Passes AAA
- White on teal #0080804.77:1 · Passes AA
- White on purple #8000809.42:1 · Passes AAA
- White on hot pink #ff69b42.65:1 · Fails
- White on light blue #add8e61.53:1 · Fails
- White on gold #ffd7001.4:1 · Fails
- Red #cc0000 on green #0099001.56:1 · Fails
Questions people ask
What is a good colour contrast ratio?
For normal text, at least 4.5:1 to meet WCAG level AA, and 7:1 for the stricter AAA level. For large text (24px, or 18.66px and bold) the limits are 3:1 for AA and 4.5:1 for AAA. Parts of buttons, icons, form borders and charts need 3:1 against what is next to them.
Is 4.5:1 contrast required by law?
No law names a ratio for every website, but WCAG level AA (4.5:1 for normal text) is the level that rules and settlements point to. Examples are the EU's EN 301 549 standard and the US Department of Justice rule for state and local governments, which both reference WCAG 2.1 AA. The ADA itself does not set a number for private businesses, though courts and settlement agreements generally use WCAG AA. This is general information, not legal advice.
Did WCAG 2.2 change the contrast rules?
No. WCAG 2.2 keeps the same contrast thresholds as 2.1: 4.5:1 and 3:1 for text, 7:1 and 4.5:1 for the enhanced level, and 3:1 for interface components and graphics. The new 2.2 rules are about other things, such as focus visibility and target size.
How is the contrast ratio calculated?
Each colour is converted to a relative luminance from 0 (black) to 1 (white), using the sRGB formula in WCAG. The ratio is (lighter + 0.05) divided by (darker + 0.05). Black on white gives 21:1 and identical colours give 1:1. This checker never rounds a failing result up across a pass mark, so 4.499 is shown as 4.49 and does not pass.
What counts as large text?
WCAG defines large text as at least 18 point (about 24 CSS pixels) in regular weight, or at least 14 point (about 18.66 pixels) in bold. Anything smaller is normal text and needs the higher ratio.
How do I check text on top of an image or a gradient?
Test the text colour against the lightest and the darkest parts of the background behind the words, and make sure the worst case passes. Adding a solid or semi-opaque panel behind the text is the dependable fix. This tool compares two flat colours, so sample the worst spot with a colour picker and enter it as the background.
Do hover, focus and disabled states need to pass too?
Hover and focus states do, because people see and use them. Text in disabled controls is exempt from the contrast rules, as are logos and purely decorative elements, but a disabled state that is very faint can still confuse people, so keep it readable where you can.
What about APCA and WCAG 3?
APCA is a newer, different way to estimate readability that is proposed for a future WCAG 3. It is still a draft and is not what laws or audits use today. This tool uses the WCAG 2 formula that applies now.
Are my colours sent anywhere?
No. The calculation runs in your browser. Your colours are not uploaded or stored, and a shared link only carries the two colour codes in its address.
My brand colour fails on a white button. What should I do?
Keep the brand colour for large shapes and decoration, and use a darker shade of the same hue for text and small controls. The Fix it panel above finds the closest passing shade with the same hue, so the brand still looks like itself.
Checked one pair? Check the whole site.
A free scan tests every colour, label and heading on your page against WCAG 2.2 and gives you a plain-English fix list. No account needed.