Skip to tool

Contrast Checker

Colors
Try:
Foreground
hex / rgb() / name
Background
hex / rgb() / name
Live preview

The quick brown fox14 px / 400

The quick brown fox18 px / 400

The quick brown fox24 px / 700

The quick brown fox32 px / 700

WCAG 2.2 contrast ratioExample values
4.54:1
Passes AA

#767676 text on #FFFFFF

APCA lightness contrast (Lc)+71.6Dark text on light bg (BoW)
Min font, 400 weight21px
Min font, 700 weight16px
AA normal (4.5:1)
Pass
AAA normal (7:1)
Fail
AA large (3:1)
Pass
AAA large (4.5:1)
Pass

WCAG 2 and APCA disagree

WCAG 2 passes AA, but APCA flags Lc < 75 (below body text threshold).
APCA font sizesMinimum Lc by size and weight
px400700
10——
11——
1210090
139585
149075
158575
167565
187560
217055
246045
285540
325035
364530
424030
483530
603030
723030
963030

WCAG contrast ratio requirements

WCAG 2 compares the relative luminance of two colors: ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color. Luminance is 0.2126 R + 0.7152 G + 0.0722 B after each sRGB channel is linearized (threshold 0.04045). The ratio runs from 1:1 (identical colors) to 21:1 (black on white). Level AA (SC 1.4.3) requires 4.5:1 for normal text and 3:1 for large text; level AAA (SC 1.4.6) requires 7:1 and 4.5:1. Large text means at least 18 pt (24 px) regular or 14 pt (about 18.66 px) bold. For example, #767676 on white is 4.54:1, which passes AA for normal text.

What is APCA?

APCA (Accessible Perceptual Contrast Algorithm, version G-4g) is a contrast model by Andrew Somers that has been proposed for WCAG 3. It is not part of any finalized W3C standard. Instead of a symmetric ratio, APCA returns a signed Lc value from about −108 to +106: positive for dark text on a light background, negative for light text on a dark background. This tool treats |Lc| ≥ 75 as the threshold for body text.

Why WCAG 2 and APCA disagree

The WCAG 2 ratio ignores which color is the text and tends to rate pairs with a dark color too generously. Black text on orange #FF8800 is 8.77:1 (AAA) but only Lc 57.5 in APCA. In the other direction, white text on #777777 is 4.48:1, just failing AA, while APCA gives Lc −76.6, above the body-text threshold. Gray #767676 on white passes AA at 4.54:1 but scores Lc 71.6. When the two results disagree, the page shows a warning banner; the sample gallery loads six such pairs.

APCA minimum font size

APCA does not use one pass/fail number. The required Lc depends on font size and weight: 14 px at weight 400 needs |Lc| ≥ 90, 16 px at weight 400 needs 75, and 24 px at weight 700 needs only 45. The table shows the smallest size that works at the current Lc for weight 400 and weight 700, so you can see whether a pair suits body text, headings, or neither.

Fix a failing color pair

When a pair is below AA for normal text (4.5:1), the result shows the nearest passing text color and the nearest passing background. Each one keeps the hue and changes only lightness in OKLCH, by the smallest amount that reaches 4.5:1; "Use this" applies it. When WCAG 2 and APCA disagree, the Adjust buttons change the foreground's lightness (HSL L) with up to 25 binary-search steps until the pair reaches APCA Lc 75 or WCAG AA 4.5:1. If the target cannot be reached, for example when both colors are near white, the tool keeps the closest result and suggests a different background.

Check colors from an image

To check text on a photo or on a screenshot of an existing design, open the Image Color Picker, sample the text and background colors from the image, and shift-click the two saved colors to see their WCAG contrast ratio. Paste the hex values here to get the APCA result and the minimum font size.

How to check color contrast

  1. Enter the text color: Type a hex value (#000 or #000000), an rgb() value, or a CSS color name into the Foreground field, or click the swatch to use the color picker.
  2. Enter the background color: Do the same in the Background field. Use Swap to exchange the two colors and check the reverse pairing.
  3. Read the results: The WCAG 2.2 panel shows the ratio and pass or fail for AA and AAA at normal and large sizes. The APCA panel shows the signed Lc and the minimum font size for weights 400 and 700. If the two disagree, a warning appears; use an Adjust button to find a foreground color that passes.

FAQ

What is a good color contrast ratio?

For WCAG 2.2 level AA, normal text needs at least 4.5:1 and large text at least 3:1. Level AAA raises this to 7:1 for normal text and 4.5:1 for large text. The highest possible ratio is 21:1, black on white. A ratio of 4.48:1 fails AA; the tool does not round up.

What counts as large text in WCAG?

Large text is at least 18 pt regular or 14 pt bold. In CSS pixels that is 24 px regular or about 18.66 px bold. Anything smaller is normal text and needs the 4.5:1 (AA) or 7:1 (AAA) ratio.

What is APCA and how is it different from WCAG 2?

APCA is a perceptual contrast algorithm proposed for WCAG 3. It returns a signed Lc value (about −108 to +106) whose sign shows polarity, and the required value depends on font size and weight. WCAG 2 returns a ratio of at least 1:1 that is the same whichever color is the text. The two agree on very high contrast but can disagree on mid-tones.

Why do my colors pass WCAG but fail APCA?

WCAG 2 tends to over-rate pairs that include a dark color or a mid-gray. Gray #767676 on white passes AA at 4.54:1 but is Lc 71.6, below APCA's body-text threshold of 75. Black on orange #FF8800 reaches 8.77:1 but only Lc 57.5. Use a darker text color or a larger, bolder font if you want both checks to pass.

Which standard should I follow?

Follow WCAG 2 for compliance. Section 508 in the US references WCAG 2.0 AA, and EN 301 549, the standard used for the European Accessibility Act, references WCAG 2.1 AA. APCA is still a proposal; use it as an extra design check on top of WCAG 2, not as a replacement.

Do icons and buttons need to meet a contrast ratio?

Yes. WCAG 2.1 and 2.2 SC 1.4.11 (Non-text Contrast) require at least 3:1 between icons, input borders, focus indicators, and other meaningful UI graphics and the colors next to them. Enter the icon color as the foreground and the surrounding color as the background, and read the WCAG ratio.