Skip to content
HNarzędzia
en
Categories

Colour contrast checker - WCAG 2.2 AA and AAA

Enter a text and a background colour (HEX, RGB or HSL) to get the contrast ratio instantly, see whether the pair meets WCAG 2.2 AA and AAA, and get the closest colour that passes.

  • Free
  • No sign-up
  • Private
  • Runs locally

HEX, rgb(), hsl() or oklch(), e.g. #1a73e8 or rgb(26, 115, 232)

HEX, rgb(), hsl() or oklch(), e.g. #1a73e8 or rgb(26, 115, 232)

Contrast ratio
4.48:1
From 1:1 (no contrast) to 21:1 (black on white)
APCA (informative)
Lc 71.1
content text from ~16 px bold / 18 px. Draft method for WCAG 3 - not a legal requirement.

Preview

Large text - 24 px heading

Normal paragraph text (16 px). The quick brown fox jumps over the lazy dog.

Small 13 px text - footnotes, form labels

ButtonForm field

WCAG 2.2 requirements

CriterionRequiredResult
AA - normal text (1.4.3)4.5:1 Fail
AA - large text (1.4.3)3:1 Pass
AAA - normal text (1.4.6)7:1 Fail
AAA - large text (1.4.6)4.5:1 Fail
UI components and graphics (1.4.11)3:1 Pass

Large text is at least 24 px (18 pt) regular or 18.66 px (14 pt) bold.

Closest colour that passes

Change text colour
#767676 · darker · 4.54:1
Change background
#060606 · darker · 4.52:1

Only the OKLCH lightness is changed - hue and chroma are kept (within sRGB).

How to do it?

  1. 1.

    Enter the text colour

    Type a HEX (#777777), rgb() or hsl() value or use the colour picker.

  2. 2.

    Enter the background colour

    Set the background the same way; the arrow button swaps the colours.

  3. 3.

    Read the result

    The ratio and the table show whether the pair passes AA and AAA for normal and large text and 3:1 for UI components.

  4. 4.

    Fix the colour

    If the contrast is too low, pick a target and click “Use” next to the suggested text or background colour.

WCAG 2.2 contrast thresholds

ElementAAAAA
Normal text4.5:1 (1.4.3)7:1 (1.4.6)
Large text (24 px+ or 18.66 px+ bold)3:14.5:1
Icons, input borders, charts, focus indicators3:1 (1.4.11)-

Thresholds are not rounded: 4.48:1 fails AA. Logos, disabled controls and purely decorative elements are exempt.

How contrast is calculated

Contrast = (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker colour (L = 0.2126·R + 0.7152·G + 0.0722·B on linearised sRGB channels). Example: #777777 has L = 0.184, white has L = 1, so the ratio is 1.05 / 0.234 = 4.48:1. The lightest grey that passes 4.5:1 on white is #767676 (4.54:1).

APCA

APCA (Accessible Perceptual Contrast Algorithm), the candidate method for WCAG 3, models how people perceive light text on dark backgrounds and thin fonts better than the WCAG 2 formula. It reports lightness contrast as Lc, from about −108 to 106; a negative value means light text on a dark background. Roughly Lc 75 suits body text, 60 content text and 45 large headings. APCA is still a draft and is shown for information only - conformance is judged against WCAG 2.x.

Common contrast mistakes

  • Light grey text on white - the popular #999 and #aaa give only 2.85:1 and 2.32:1.
  • Placeholder text used as a label - default placeholder greys usually fall below 4.5:1.
  • White text on a mid-tone button - white on #4A90E2 is about 3.3:1, enough only for large text.
  • Faint input borders - a #ddd border on white (1.36:1) fails the 3:1 rule of 1.4.11.
  • Text over photos - measure against the lightest part of the image behind the text, or add a semi-transparent overlay.

The suggestion feature changes only OKLCH lightness, so a blue button stays blue, just darker or lighter. To convert the result to RGB, HSL or other formats, use the colour converter.

Many accessibility laws point to WCAG level AA: the European Accessibility Act (applied from June 2025) via EN 301 549, Section 508 in the US federal sector, and public-sector rules in many countries. WCAG 2.2 did not change the contrast thresholds, so a pair that passes 2.2 also passes 2.1 and 2.0.

Frequently asked questions

What contrast ratio does WCAG require?

+
AA requires 4.5:1 for normal text, 3:1 for large text and 3:1 for UI components and graphics. AAA requires 7:1 for normal and 4.5:1 for large text.

Does #777 on white pass WCAG?

+
Not for normal text - it is 4.48:1. Darken it to #767676 (4.54:1). It does pass for large text and icons.

Did WCAG 2.2 change contrast requirements?

+
No. The thresholds are the same as in WCAG 2.1.

How is transparency handled?

+
A semi-transparent text colour is composited over the background, and a transparent background over white, before calculating the ratio - so you get the contrast the user actually sees.

Can I round 4.48:1 up to 4.5:1?

+
No. WCAG thresholds are minimums without rounding, so 4.499:1 still fails the 4.5:1 requirement. When rounding would push a value over a threshold, the tool truncates it instead (4.499 shows as 4.49).

What counts as large text in WCAG?

+
At least 18 pt (24 px) at regular weight or 14 pt (about 18.66 px) bold. Large text needs only 3:1 for AA and 4.5:1 for AAA.

Do logos and disabled buttons need to meet contrast?

+
No. Logos, text that is part of a decoration and inactive (disabled) controls are exempt. Active buttons, icons and form field borders need at least 3:1.

Updated: