Skip to content
ColorsGuide

Colour contrast checker

Test text and interface colours against the WCAG 2.2 contrast requirements, and get the nearest accessible alternatives when a pair falls short.

Example paletteUsed until you create or choose your own

Contrast ratio

7.12:1

Large text, 24px (18pt) regular or 18.66px bold

Normal body text at 16px. The quick brown fox jumps over the lazy dog. Good contrast keeps text readable in bright sunlight and for people with low vision.

Small text at 14px, often used for captions and metadata.

Normal text AA

needs 4.5:1

Pass

Normal text AAA

needs 7:1

Pass

Large text AA

needs 3:1

Pass

Large text AAA

needs 4.5:1

Pass

UI components & graphics

needs 3:1 (SC 1.4.11)

Pass

Interface preview

The foreground colour used as a button, an input border, an icon and a link on your background.

Primary buttonOutline buttonInput fieldA text link

WCAG 1.4.11 asks for 3:1 between a component's visual boundary or state and adjacent colours. Decorative graphics and disabled controls are exempt.

Accessible alternatives

The nearest colours with the same hue that reach each level, found by adjusting OKLCH lightness.

  • AaText colour for AA (4.5:1)#1F2937 (7.12:1)
  • AaText colour for AAA (7:1)#1F2937 (7.12:1)
  • AaBackground for AA (4.5:1)#F4A261 (7.12:1)

Light and dark backgrounds

On white

14.67:1

AA text

On black

1.43:1

Fails

APCA (informational)

Lc 59.4: Large or bold headlines.

APCA is a newer perceptual contrast model from the WCAG 3 drafts. It accounts for polarity (dark-on-light versus light-on-dark) and is not a WCAG 2.2 conformance measure. Use the WCAG ratio above for compliance, and APCA as a second opinion.

Checking a whole palette? Use the palette contrast grid.

WCAG 2.2 contrast requirements

WCAG measures contrast as a ratio between the relative luminance of two colours, from 1:1 (identical) to 21:1 (black on white). Success criterion 1.4.3 (level AA) asks for at least 4.5:1 for normal text and 3:1 for large text. Criterion 1.4.6 (AAA) raises these to 7:1 and 4.5:1. Large text means at least 18 point (24 CSS pixels) or 14 point bold (about 18.66 CSS pixels).

Criterion 1.4.11 (non-text contrast, AA) asks for 3:1 for the parts of user interface components and graphics needed to understand them, such as input borders, focus indicators, icons and chart lines. Logos, incidental text and disabled controls are exempt.

Ratios here are truncated rather than rounded, so a pair at 4.499:1 is shown as 4.49 and fails. Translucent text is blended over the background before measuring.

WCAG ratios versus APCA

The WCAG 2 formula is the legal and contractual standard in most places today. It is simple and conservative, but it treats dark text on a light background and light text on a dark background the same, and it can overrate contrast for some dark colour pairs. APCA (the Accessible Perceptual Contrast Algorithm) was developed for the WCAG 3 drafts; it models perceived lightness contrast, accounts for polarity and ties targets to font size and weight. It is shown here for information only and is not a WCAG 2.2 conformance test.

Automated checks are not a full audit

A passing ratio means the colours meet one measurable criterion. It does not make a page accessible by itself: text over images, gradients, focus states, colour-only meaning and real content all need checking in context, ideally with people who use assistive technology. Also try the colour blindness simulator to make sure information never relies on hue alone.

Was this page useful?