Is the text easy enough to read?

Is this text easy enough to read on this background?

Type the colour of the text and the colour behind it, or pick them. You get the contrast ratio, the grades of the Web Content Accessibility Guidelines it passes, the text on its background to look at, and the nearest colour that passes if it does not.

The two colours

Worked out on this device. The colours you type are not sent or kept.

The two colours

A hex code, rgb(), hsl() or a colour name.

A hex code, rgb(), hsl() or a colour name.

The pair

Body text

Large text, 24 pixels

Normal text, 16 pixels. The lagoon was flat and the mountain stood in it twice.

A control3 to 1 is needed for its edge

7.14 to 1

  • AA normal textNeeds 4.5 to 1 · WCAG 1.4.3Passes
  • AA large textNeeds 3 to 1 · WCAG 1.4.3Passes
  • AAA normal textNeeds 7 to 1 · WCAG 1.4.6Passes
  • AAA large textNeeds 4.5 to 1 · WCAG 1.4.6Passes
  • AA controls and graphicsNeeds 3 to 1 · WCAG 1.4.11Passes

Passes AAA for normal text and AA for everything.

This site’s own pairs

Worked out when the site was built, from the colours in its style sheet, by the same arithmetic as the checker above, so a change to a colour there changes this table. A row that fails for normal text and passes for large text is a colour that is fine for big or bold type and short of 4.5 to 1 for small print. Amber and blue on paper are for rules and underlines, and are measured here against the 3 to 1 that graphics need.

Contrast ratio of the site’s colour pairs
PairWhere it is usedRatioAA normal textAA large textGraphics, 3 to 1
Body textparagraphs on the page7.14 to 1PassesPassesPasses
Headingstitles and rules17.35 to 1PassesPassesPasses
Quiet textcaptions and secondary lines7.14 to 1PassesPassesPasses
Quiet text on a sheetnotes inside a white card7.57 to 1PassesPassesPasses
Amber inka warning beside its label or icon4.73 to 1PassesPassesPasses
Violet on papera link on hover and a selected state5.37 to 1PassesPassesPasses
Dark paneltext on a night panel17.35 to 1PassesPassesPasses
Dark panel, white textheadlines on a night panel18.4 to 1PassesPassesPasses
Amber on a dark panelthe accent on a night panel8.57 to 1PassesPassesPasses
Main buttonthe main button: white words on the action blue6.7 to 1PassesPassesPasses
Navy on ambera small highlight, words always navy8.57 to 1PassesPassesPasses
Green textan approved or ready state4.71 to 1PassesPassesPasses
Blue on paperrules and underlines, not text3.46 to 1FailsPassesPasses
Amber on paperrules and underlines, not text2.02 to 1FailsFailsFails

How it works

The ratio is the one in the Web Content Accessibility Guidelines 2.2: (L1 + 0.05) ÷ (L2 + 0.05), where L is the relative luminance of the lighter and the darker colour. It is not the newer APCA method, which scores differently.

The grades: AA normal text needs 4.5 to 1; AA large text needs 3 to 1; AAA normal text needs 7 to 1; AAA large text needs 4.5 to 1; AA controls and graphics needs 3 to 1. Large text is 18 points (24 pixels) or more, or 14 points (about 18.7 pixels) or more in bold. The ratio is cut to two decimals, never rounded up, so a pair that shows 4.5 does pass and one that shows 4.49 does not.

The text colour moves toward black or toward white, a 255th of the way at a time, until the pair passes; the page offers the smaller move. A colour with some transparency is read as lying on its background, and a see-through background as lying on white.

The guidelines do not ask for a ratio on a logo, on text that is only decoration, on text that is not meant to be read, or on a control that is switched off. A ratio is one check. It says nothing of the size of the text, the space round it, colour used alone to carry a meaning, or how it looks to someone with colour blindness.

What it is built with

No library: the arithmetic is the guidelines’ own, written in this site’s code. contrast-ratio (MIT) is kept in the repository only to check it against.

Ask Innerverse

Guided answers from our website. This is not a live conversation with a person.