Skip to contentHydramill Utilities

WCAG contrast checker: test text and background colours for AA and AAA

Check the contrast ratio between two colours against WCAG 2.x AA and AAA for normal text, large text and interface parts, see a live sample, and get the nearest colour that passes.

100 % in your browser: your files and text never leave your device and nothing is uploaded.

Large sample textSmall sample text: the quick brown fox jumps over the lazy dog.
  • 4.48:1Contrast ratio
  • FailNormal text AA (4.5:1)
  • FailNormal text AAA (7:1)
  • PassLarge text AA (3:1)
  • FailLarge text AAA (4.5:1)
  • PassUI components AA (3:1)

Nearest passing colour

#7676764.54:1

How it works

Pick or type a text colour and a background colour in HEX or rgb(). The contrast ratio is the one defined by WCAG 2.x, from 1:1 to 21:1. Normal text needs 4.5:1 for AA and 7:1 for AAA; large text (18 pt, or 14 pt bold) needs 3:1 and 4.5:1; icons, borders and form controls need 3:1. The checks use the exact ratio and the figure shown is rounded, so #777777 on white shows 4.48:1 and fails AA for normal text. If a pair fails, choose a target and the tool finds the closest text colour with the same hue that passes, changing only its lightness.

How to use it

  1. Enter the Text colour and the Background colour in HEX (#777777) or rgb(119, 119, 119), or pick them with the colour selector. Use Swap to reverse them.
  2. Read the Contrast ratio, from 1:1 to 21:1, and the Pass or Fail result for each WCAG level: normal text AA and AAA, large text AA and AAA, and UI components.
  3. Look at the live sample texts to judge legibility with your own eyes.
  4. If the pair fails, choose a Goal (3:1, 4.5:1 or 7:1) in Nearest passing colour and press Use this colour. Only the lightness changes, so the hue stays.

Worked example

Grey #777777 on white gives 4.48:1. It looks fine, but normal text needs 4.5:1 for AA, so it fails by a hair (the checks use the exact ratio; the figure is only rounded for display). Its large-text AA and UI checks pass at 3:1. With the goal 4.5:1 the tool suggests #767676, which gives 4.54:1 and passes. For AAA at 7:1 it proposes #595959. White text on orange #e67e22 reaches only 2.85:1 and fails every level, while white on dark blue #0b5394 gives 7.84:1 and passes AAA.

Frequently asked questions

What is a good contrast ratio?

WCAG 2.x asks for 4.5:1 for normal text at level AA and 7:1 at AAA. Large text (18 pt, or 14 pt bold) needs 3:1 and 4.5:1, and icons, borders and form controls need 3:1.

Is the colour data sent anywhere?

No. The calculation happens in your browser.

Why does 4.48:1 fail if it looks like 4.5?

The checks use the exact ratio, not the rounded number shown. 4.478 is below 4.5, so it fails, just as WCAG tools and auditors judge it.

Which colour formats can I type?

Three- or six-digit HEX such as #777 or #777777, and rgb(119, 119, 119) or the plain numbers 119, 119, 119.

Does contrast guarantee accessibility?

No. It covers one part of WCAG. You also need meaningful text, not relying on colour alone, and checks for people with colour vision differences.