Text & documents
Numbers & maths
Data & formats
Security
Development & DevOps
Artificial Intelligence
Finance
Health & Wellness
Productivity
Games & Entertainment
Multimedia & design
Business
How to use
What it is and what it's for

Checks whether two colours —the text and the background— stand apart enough for anyone to read them, including people with low vision or colour blindness. It computes the contrast ratio between the two and compares it against the official WCAG 2.1 accessibility thresholds. The ratio ranges from 1:1 (two identical colours, unreadable) to 21:1 (pure black on pure white). All the maths runs in your browser: nothing is uploaded to any server.

How to use it (step by step)

1. Click the Text colour picker and choose the colour of the lettering.
2. Click the Background colour picker and choose the background it will sit on.
3. The preview shows a real sample with those two colours, and below it the ratio and the four PASS/FAIL badges appear.
4. Everything recomputes instantly as you move the pickers; next to each one you can see the chosen #rrggbb value.

What the ratio is and how it's computed

The contrast ratio measures how much difference in light there is between the two colours. It's computed in two steps:

Relative luminance — for each colour the light the eye perceives is computed with the WCAG formula: each R, G and B channel is scaled to 0-1, gamma-corrected (linearised) and combined weighted as 0.2126·R + 0.7152·G + 0.0722·B (green weighs more because the eye sees it as brighter). The result ranges from 0 (black) to 1 (white).
Ratio — with the luminance of the lighter colour (L1) and the darker one (L2), it applies (L1 + 0.05) / (L2 + 0.05). The +0.05 avoids extreme divisions. It's symmetric: it doesn't matter which colour is the text and which is the background, the ratio is the same.

WCAG levels: AA and AAA

Each combination is evaluated against four official thresholds. AA is the legal, recommended minimum; AAA is the enhanced level (prolonged reading or low-vision audiences):

AA — normal text: ratio ≥ 4.5:1.
AA — large text: ratio ≥ 3:1.
AAA — normal text: ratio ≥ 7:1.
AAA — large text: ratio ≥ 4.5:1.

Large text demands less because its strokes are thicker and easier to read. Aim for AA at least; for AAA if you can.

Icons and interface components

The thresholds above are for text. Non-text elements have their own WCAG rule (criterion 1.4.11): field borders, icons, form controls and the meaningful parts of a graphic need a contrast of at least 3:1 against what sits next to them. This tool shows the four text badges; for an icon or a border, just check that the ratio reaches 3:1 even if the "AA normal" badge fails.

What counts as large text

Text counts as large —and gets the softer thresholds— when it's 18pt or bigger (roughly 24px), or 14pt or bigger (roughly 18.67px) when bold. Below those sizes it counts as normal text and must meet the stricter threshold. The preview includes a line of each size so you can compare.

How to read PASS / FAIL

Below the ratio there are four rows, one per criterion, each with a badge:

PASS (green, with a tick) — that combination meets that level.
FAIL (red, with a cross) — it does not meet it; the contrast needs to go up.

Since the thresholds increase, if it passes AAA normal (7:1) it passes all the others too. Text that only passes "AA large" (3:1) is not valid for normal text.

Tips to improve contrast

If a combination fails:

Darken the text or lighten the background (or the reverse): the greater the difference in luminance, the higher the ratio.
Don't rely on hue alone — two vivid colours (red on green) can have a very low contrast despite "clashing". What counts is the light, not the colour.
Mid grey is treacherous: light-grey text on white usually fails; push it towards black.
Don't use colour alone to convey information (links, errors): back it up with an underline, an icon or text.
• Adjust the pickers until the badge you care about turns to PASS.

WCAG ContrastWCAG AA/AAA contrast ratio
WCAG ContrastVerify colour contrast against WCAG 2.1
#000000
#ffffff
Normal text — Aa Bb Cc 0-9Large text — Aa Bb Cc 0-9
Contrast ratio21.00:1
AA Normal text (≥4.5:1) PASS
AA Large text (≥3:1) PASS
AAA Normal text (≥7:1) PASS
AAA Large text (≥4.5:1) PASS

Large text = 18pt+ (24px) or 14pt+ (18.67px) bold