Colour converter and contrast checker

Pick a text colour and a background to see their contrast ratio and whether they pass WCAG 2.2. Each colour is also shown as HEX, RGB and HSL to copy.

runs in your browser · nothing uploaded

loading tool…

How to use it

  1. Enter a text colour and a background colour as HEX, rgb() or hsl(), or use the pickers.
  2. Read the contrast ratio and the AA and AAA results for normal and large text.
  3. Copy either colour in HEX, RGB or HSL.

What the WCAG levels mean

WCAG 2.2 success criterion 1.4.3 (level AA) asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Criterion 1.4.6 (level AAA) asks for 7:1 and 4.5:1. Large text means at least 18 point (24px) regular, or 14 point (about 18.7px) bold.

The ratio runs from 1:1 (identical colours) to 21:1 (black on white). It is computed from each colour's relative luminance, using the formula WCAG defines.

Why the ratio is never rounded up

WCAG thresholds are strict: 4.49:1 fails AA. This tool truncates the displayed ratio to two decimals instead of rounding, so a failing pair never looks like a pass.

Questions

Is what I paste sent to a server?

No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is uploaded, logged or stored by us, so it is safe to use with real data.

Does it handle transparency?

Not yet. Alpha values are ignored, because the real contrast of a translucent colour depends on what is behind it. Check the flattened colour instead.

What about WCAG 3 and APCA?

WCAG 3 is still a draft and its contrast method may change. Laws and procurement rules today refer to WCAG 2.x, which this tool checks.