handy.moe

All tools / Debug tools

An artist with a palette and brush

Contrast checker

Check whether two colours have enough contrast for WCAG AA and AAA, with a live sample and a suggestion if they fail.

Runs in your browser. Pasted data never leaves it.

Large text sample, 24px

Normal text sample, 16px. The quick brown fox jumps over the lazy dog.

Button ◆ UI element

How to use it

  1. Enter the text colour and the background colour, in any CSS colour format, or use the pickers.
  2. Read the ratio and the pass or fail for normal text, large text and UI parts at WCAG AA and AAA.
  3. The sample shows how the pair looks. Press “Suggest” to get the closest passing text colour.

Questions

What contrast ratio do I need?

WCAG 2.x asks for at least 4.5:1 for normal text (AA), 3:1 for large text (24px, or 19px bold) and for icons and input borders, and 7:1 (AAA) for the highest level. Logos and disabled controls are exempt.

How is the ratio computed?

From the relative luminance of each colour: (Llighter + 0.05) ÷ (Ldarker + 0.05), using the sRGB formula in WCAG 2.2. Transparent text colours are mixed over the background first.

What about APCA?

APCA is a newer, perceptual method proposed for WCAG 3. It is not yet a standard, so this page reports the WCAG 2 ratio that accessibility laws and audits refer to.

What does “Suggest a passing text colour” do?

It darkens or lightens your text colour, keeping its hue, until it reaches 4.5:1 against the background (using the smallest change that passes).

Is what I paste or test sent anywhere?

No. This page works entirely inside your browser, and pasted data never leaves your device. It makes no network requests while you use it, and the page also tells your browser to block them (a Content-Security-Policy with connect-src 'none'), so even a bug could not send your data out. To check it yourself, open your browser's developer tools, go to the Network tab, and use the tool: nothing will appear. There is no account, no analytics and no logging.