Contrast Checker
Check the WCAG contrast ratio between text and background colours, with AA and AAA results.
Runs in your browser — nothing is uploaded
Contrast ratio
5.94:1
- Normal text · WCAG AA (4.5:1)Pass
- Normal text · WCAG AAA (7:1)Fail
- Large text · WCAG AA (3:1)Pass
- Large text · WCAG AAA (4.5:1)Pass
- UI components & graphics · WCAG AA (3:1)Pass
Preview
Large text, 24px bold
Normal body text at 15px. The quick brown fox jumps over the lazy dog. Readable contrast helps people with low vision, and everyone reading on a phone in sunlight.
Button outlineHow to use Contrast Checker
- 1
Enter the Text colour and Background colour as HEX, rgb() or hsl(), or use the colour boxes.
- 2
Read the contrast ratio and the Pass or Fail result for each WCAG level.
- 3
Check the Preview to see body text, large text and an outlined button in your colours.
- 4
If normal text fails AA, click Use it next to the suggested colour, or click Swap to flip the two colours.
About this tool
The contrast ratio follows the WCAG 2 formula: (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the relative luminance of the lighter colour and L2 that of the darker. Relative luminance weights green most, then red, then blue, because that is how sensitive our eyes are to each. Ratios run from 1:1 (identical colours) to 21:1 (black on white).
WCAG level AA asks for at least 4.5:1 for normal text and 3:1 for large text, which is 24px (18pt) regular or about 18.7px (14pt) bold. Level AAA asks for 7:1 and 4.5:1. User interface parts such as input borders and icons need 3:1 under WCAG 2.1. WCAG says ratios must not be rounded up, so this tool truncates the displayed value: 4.499 shows as 4.49:1 and fails.
When normal text fails AA, the tool suggests the closest passing text colour by mixing yours toward black or white, so you keep the same hue. Contrast is only one part of accessibility; also avoid relying on colour alone to convey meaning.
Questions people ask
What contrast ratio do I need for WCAG AA?
At least 4.5:1 for normal text and 3:1 for large text (24px regular or about 18.7px bold and up). AAA needs 7:1 and 4.5:1.
Does grey text on white pass WCAG?
It depends on the shade. #767676 on white is about 4.54:1 and passes AA; anything lighter, such as #777777, falls just below 4.5:1.
Do logos and disabled buttons need to pass?
No. WCAG exempts logos, decorative text and inactive (disabled) controls from the contrast requirement.
What is the contrast ratio of black on white?
21:1, the maximum possible.
Related tools
- Color PickerPick a colour and copy its HEX, RGB, HSL, HSV and CMYK values, with tints and shades.
- Color Palette GeneratorBuild a colour scheme from one base colour and export it as CSS variables.
- HEX to RGB ConverterConvert a HEX colour code to RGB and HSL, or edit any value to convert the other way.
- CSS Gradient GeneratorDesign a linear or radial CSS gradient with up to four colours and copy the code.