Color contrast checker

Check the contrast ratio between two colors according to WCAG 2.x, with the AA and AAA result for text, large text and graphical objects. If it falls short, you get the closest color that works.

Your data stays on your computer. Files are processed in your browser and are never uploaded.

HEX (3, 4, 6 or 8 digits), rgb(), hsl(), oklch() or a CSS name such as rebeccapurple.

Contrast ratio

4.54:1

Result

  • AA · normal text · needs 4.5:1 Pass
  • AAA · normal text · needs 7:1 Fail
  • AA · large text · needs 3:1 Pass
  • AAA · large text · needs 4.5:1 Pass
  • AA · graphical objects and components · needs 3:1 Pass

Large text: at least 24 px, or 18.5 px bold. The ratio is truncated to two decimals, not rounded.

Preview

Normal text at 16 px: the quick brown fox jumps over the lazy dog.

Large text at 24 px

Filled buttonOutline button

Conversions

Text color

HEX
#767676
RGB
rgb(118 118 118)
HSL
hsl(0 0% 46%)
OKLCH
oklch(56.58% 0 0)

Background color

HEX
#ffffff
RGB
rgb(255 255 255)
HSL
hsl(0 0% 100%)
OKLCH
oklch(100% 0 0)

Suggestion

The closest color that reaches the goal, changing only the lightness in OKLCH (hue and chroma stay, as far as the sRGB gamut allows).

Color to change

For AA (4.5:1)

The current color already reaches it.

For AAA (7:1)

Sample text
#595959

7.00:1 · lightness -10 points

How it is computed

The ratio is (L1 + 0.05) / (L2 + 0.05), where L is the relative luminance of the lighter (L1) and darker (L2) color, computed from linearised sRGB channels. It runs from 1:1 to 21:1 (black on white).

What it does not tell you

Contrast is a minimum requirement, not a guarantee of legibility: size, font weight and uneven backgrounds matter too. WCAG 3 (APCA) uses a different model, not included here.

Where the data goes

Everything happens on this page: nothing is saved, put in the address or sent.

Keyboard shortcuts

In this tool

This tool has no keyboard actions.

Everywhere

Open this panel (outside text fields)
?
Closes panels and menus, never clears data
Esc
Search for a tool
/ or CtrlK

Tool chains

Link several tools into a path: after using a tool, “Send to…” offers the next step first. Saved chains keep only a name and the tools, never your data.

Saved chains

No saved chains.

New chain