Color contrast checker (WCAG)
Enter both colors as hex (#1f2937) or rgb(31, 41, 55).
Result
4.54:1Contrast ratio
- AA, normal text (4.5:1)
- ✓
- AA, large text (3:1)
- ✓
- AAA, normal text (7:1)
- ✕
- AAA, large text (4.5:1)
- ✓
- Colors read
- #767676 / #ffffff
Inputs
- Text color
- #767676
- Background color
- #ffffff
How it is calculated
Each color’s relative luminance is computed from its linearized sRGB channels.
Result
Contrast ratio
- AA, normal text (4.5:1)
- ✓
- AA, large text (3:1)
- ✓
- AAA, normal text (7:1)
- ✕
How it is calculated
- Each color’s relative luminance is computed from its linearized sRGB channels.
- Ratio = (lighter L + 0.05) ÷ (darker L + 0.05), from 1:1 to 21:1.
- The ratio is compared with the WCAG 2 thresholds without rounding.
Example
#767676 on white gives 4.54:1: AA for normal text, not AAA.
Good to know
- Large text is at least 24 px, or 18.66 px bold.
- Transparency and gradients are not taken into account.
When to use it
- Check that a text colour stays readable on a button or a banner.
- Choose brand colours that pass accessibility rules.
- To make a QR code with readable colours, use the QR code generator.
Frequently asked questions
What ratios do I need?
Level AA asks for 4.5:1 for normal text and 3:1 for large text. Level AAA asks for 7:1 and 4.5:1.
Do icons and buttons count?
Yes. Icons, input borders and focus outlines need at least 3:1 against what is next to them.
Is a text on a photo covered?
The rule still applies, but the contrast changes across the image. Add a solid or dark overlay behind the text to keep it readable.