Make sure your text can be read.

Pick a text colour and a background colour and you get the contrast ratio straight away, with a pass or fail for each WCAG level. A sample panel shows the pair at two sizes, so you can judge it by eye as well.

If normal text falls short of 4.5:1, the checker proposes a version of your text colour that keeps its hue and only changes its lightness.

Runs in your browser. Nothing is uploaded.

Large text, 24px

Normal body text at 17px. The quick brown fox jumps over the lazy dog.

Contrast ratio

—

AA · normal text (4.5:1)
AA · large text (3:1)
AAA · normal text (7:1)
AAA · large text (4.5:1)
UI components & icons (3:1)

More design & colour tools · All 54 tools

How to use it

  1. Type a hex code into Text colour, or click the swatch beside it to use the colour picker.
  2. Do the same for Background colour. Short codes such as #fff work too.
  3. Read the Contrast ratio and the Pass or Fail beside each row of the table.
  4. If normal text fails, try the suggested colour the checker offers.
  5. Press Swap colours to preview the reverse pair, for example light text on a dark button.

Good to know

How the ratio is worked out

WCAG 2.x compares the relative luminance of the two colours. Each sRGB channel (0 to 255) is scaled to 0 to 1 and linearised, then the three channels are weighted by how bright they look to the eye:

c = value ÷ 255
linear = c ÷ 12.92                    when c ≤ 0.04045
linear = ((c + 0.055) ÷ 1.055)^2.4    otherwise
L = 0.2126 × R + 0.7152 × G + 0.0722 × B
ratio = (L1 + 0.05) ÷ (L2 + 0.05)

L1 is the luminance of the lighter colour and L2 that of the darker one, so the ratio runs from 1:1 (two identical colours) to 21:1 (black on white).

A worked example

Grey #777777 has 119 in each channel. 119 ÷ 255 = 0.4667, which linearises to 0.1845, so L = 0.1845. Against white (L = 1): (1 + 0.05) ÷ (0.1845 + 0.05) = 4.48. That fails AA for normal text by a hair. One step darker, #767676, gives 4.54 and passes. The checker compares the unrounded figure with each threshold and never rounds a failing result up to 4.50, so a pass on screen is a real pass.

Which threshold applies

UseAAAAA
Normal text4.5:17:1
Large text: 24px, or about 18.66px bold3:14.5:1
Icons, input borders, focus rings3:1no higher level

The text rows come from WCAG 2.2 success criteria 1.4.3 (Contrast, Minimum) and 1.4.6 (Contrast, Enhanced). The row for interface parts is 1.4.11, Non-text Contrast. Large text means at least 18pt, or 14pt bold, which is 24px or about 18.66px on screen.

Limits

  • Only solid hex colours are checked. For a semi-transparent colour, check the colour you actually see once it is blended with what sits behind it.
  • Text over a photo or a gradient changes contrast from spot to spot. Check the lightest and the darkest areas behind the words.
  • The ratio is a minimum, not a promise. Very thin fonts and tiny sizes can still be hard to read at a passing ratio.

Questions.

Why does #777777 fail when it looks fine to me?

It reaches 4.48:1 on white, just under the 4.5:1 that WCAG AA asks for normal text. Many people read with low vision, a dim screen or in bright sunlight, and the threshold is set with them in mind. #767676 is the lightest neutral grey that passes on white.

How is the suggested colour chosen?

The checker keeps the hue and saturation of your text colour and moves its lightness one step at a time, darker or lighter, until it reaches 4.5:1 on your background. It picks whichever direction needs the smaller change. If no shade of that hue gets there, it tells you to change the background instead.

Do I need to meet AAA?

Most accessibility laws and policies point to level AA. AAA is worth aiming for in long reading text, such as articles, help pages and settings screens, but WCAG does not expect AAA across a whole site.

Does the order of the two colours matter?

No. The ratio is the same either way round, because the formula always puts the lighter colour on top. Swap colours is there so you can see the reverse pair in the preview.

Do logos and disabled buttons have to pass?

WCAG makes an exception for text that is part of a logo and for controls that are switched off. Disabled buttons should still be easy to spot, so keep them clearly visible even though they are exempt.

Is this the APCA method?

No. APCA is a newer contrast model being discussed for a future version of WCAG. This checker uses the WCAG 2.x formula, which current guidelines and audits refer to.