WCAG Color Contrast Checker
Check the contrast ratio between a text color and background and whether it passes WCAG AA and AAA for normal and large text.
Result
How to use this calculator
- Enter the text (foreground) color as a hex value.
- Enter the background color as a hex value.
- Read the contrast ratio and the AA/AAA pass-fail results.
- Aim for at least 4.5:1 (AA) for body text, 3:1 for large text.
About this calculator
Color contrast is the difference in luminance between text and its background, and it is one of the most important factors in whether people — especially those with low vision — can read your content. The Web Content Accessibility Guidelines (WCAG) define a contrast ratio from 1:1 (no contrast) to 21:1 (black on white) and set minimum thresholds: AA, the common legal standard, requires at least 4.5:1 for normal text and 3:1 for large text; AAA, the enhanced level, requires 7:1 and 4.5:1. This checker takes a text color and a background color in hex, computes their relative luminance using the official WCAG formula, and reports the ratio along with pass/fail for each level and text size. Use it to verify that your color choices are legible before shipping a design. Remember that large text is defined as 18pt (24px) regular or 14pt (18.66px) bold.
How it works — the formula
Linearize: c/255 ≤ 0.03928 ? /12.92 : ((c/255+0.055)/1.055)^2.4
Luminance L = 0.2126·R + 0.7152·G + 0.0722·B
Ratio = (L_light + 0.05) / (L_dark + 0.05)Each channel is linearized to account for gamma, weighted to perceived brightness, then the two luminances form the ratio with a 0.05 ambient term.
Worked examples
- Inputs:
- fg=#000000, bg=#ffffff
- Output:
- 21:1 — passes everything
- Inputs:
- fg=#777777, bg=#ffffff
- Output:
- 4.48:1 — fails AA normal (just under 4.5)
- Inputs:
- fg=#1a73e8, bg=#ffffff
- Output:
- 4.51:1 — passes AA normal
Limitations
- Uses WCAG 2.1 luminance; the newer APCA model (WCAG 3 draft) differs.
- Assumes opaque colors — alpha/transparency is not composited.
- Contrast is one of several accessibility considerations.
Computed per the official WCAG 2.1 formula.
Frequently asked
What is a good color contrast ratio?+
How is the contrast ratio calculated?+
What counts as "large text" in WCAG?+
What is the difference between AA and AAA?+
Does contrast apply to icons and UI elements?+
Is high contrast always better?+
Related calculators
More tools you might like
Hand-picked tools that pair well with this one — same audience, same intent.
Convert a color between HEX, RGB, and HSL formats, with the parsed channel values and CSS-ready strings.
Generate a harmonious color palette — complementary, analogous, triadic, tetradic, or monochromatic — from a base color.
Convert a color between hex, RGB, HSL, HWB, and CMYK. Reports relative luminance and WCAG 2.2 contrast ratio against white and black.
Sample text-run and background colors across a PDF and flag pairs that fall below WCAG-AA contrast ratios.
LTV / CAC ratio. Healthy SaaS: 3:1+; under 1:1 burns money.
Convert numbers between hexadecimal, binary, octal, and decimal. Shows the bit pattern grouped by nibble + the two’s-complement representation for negative values.