Color Contrast Checker
Measure text contrast before you ship a palette.
- Local by default
- No signup
- AI is opt-in
Checks WCAG 2.2 contrast for normal text, large text and UI components.
Normal text — 16px regular. The quick brown fox jumps over the lazy dog.
Large text — 24px bold.
Contrast ratio
16.98:1
Ratios are computed from sRGB relative luminance per WCAG 2.2. Alpha channels and colors outside sRGB are not modelled; use opaque colors for an accurate result.
Check whether a foreground and background color meet WCAG 2.2 contrast requirements. The ratio is computed from sRGB relative luminance, with separate thresholds for normal text, large text and interface components, and the colors never leave your browser.
What the contrast ratio measures
WCAG defines contrast as a ratio between the relative luminance of two colors: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color. Luminance is not brightness as a screen displays it; each sRGB channel is first linearised, then weighted by the human eye: 0.2126 for red, 0.7152 for green and 0.0722 for blue.
channel = c / 255
linear = channel <= 0.03928
? channel / 12.92
: ((channel + 0.055) / 1.055) ^ 2.4
L = 0.2126 * R + 0.7152 * G + 0.0722 * B
ratio = (max(L1, L2) + 0.05) / (min(L1, L2) + 0.05)The result ranges from 1:1 for identical colors to 21:1 for black on white. Because the formula uses the lighter color as the numerator, the order of foreground and background does not matter — which is why the swap button changes the preview but not the ratio.
The AA and AAA thresholds
- Normal text, AA (1.4.3): at least 4.5:1.
- Normal text, AAA (1.4.6): at least 7:1.
- Large text, AA: at least 3:1.
- Large text, AAA: at least 4.5:1.
- Non-text UI (1.4.11): at least 3:1 for component boundaries, icons and focus indicators.
AA is the level most policies and procurement rules require. AAA is stricter and often impossible to reach with brand colors, especially for muted text on tinted backgrounds. The tool reports all five checks so you can see which level a pair reaches rather than a single pass or fail.
What counts as large text
WCAG treats text as large when it is at least 18pt, or at least 14pt and bold. In CSS pixels that is about 24px regular or 18.66px bold, because 1pt equals 1.333px at the standard 96dpi reference. The definition is about the rendered size, not the font size declared in a stylesheet: a media query or a browser zoom level can change it.
The preview on this page renders one 16px paragraph and one 24px bold paragraph. If the 16px sample is hard to read but the 24px one passes, the issue is the size-weight combination, not just the color pair. Contrast is one axis of legibility; font weight, letter spacing and stroke width matter too.
Limits of this check
- Alpha is ignored. An
rgba()value is read as its opaque base color. Real compositing against a background can produce a different result, sometimes worse. - Only sRGB is modelled. Display P3 and other wide-gamut colors may render differently; convert to sRGB before checking.
- Gradients and images are not handled. A text color over a photo must be checked against the worst area behind it.
- Anti-aliasing and subpixel rendering are not modelled. Thin fonts can look lighter than the ratio suggests.
- It does not check focus rings, borders or disabled states unless you feed those exact colors in.
A ratio is a necessary condition, not a readability guarantee. Contrast can pass while text remains unreadable because of tiny size, low weight, letter spacing, motion or a busy background.
When a pair fails
The fastest fix is usually to darken the text or lighten the background, not to change the hue. Moving a gray from 40% to 30% lightness often crosses the 4.5:1 line without changing the brand palette. If the design depends on a tinted background, check the tint at both ends of the gradient or card, because the lightest area is where text fails first.
For large headings and buttons, the 3:1 threshold gives more room, but do not use large text as an excuse to make body copy low contrast. If a design only passes at AAA by turning text pure black on pure white, the problem is the surrounding palette, not the text color.
WCAG 3 and APCA
WCAG 3 is a draft and not a published standard. It introduces APCA, a different contrast model that accounts for font size and weight more directly and produces a lightness-contrast score rather than a ratio. APCA is useful research, but it is not what current audits or legal requirements reference. Do not label a page “APCA compliant” as if it satisfied WCAG 2.2.
This checker implements the WCAG 2.x formula only. That is deliberate: it is the formula used by current accessibility tools, procurement checklists and the conformance language in WCAG 2.2.
Frequently asked questions
What contrast ratio do I need?
For normal body text, 4.5:1 meets AA and 7:1 meets AAA. For large text — at least 18pt, or 14pt bold — the thresholds are 3:1 and 4.5:1. Interface components and meaningful graphics need 3:1 under 1.4.11.
Is 14pt bold considered large text?
Yes. WCAG counts text as large at 18pt regular or 14pt bold. In CSS pixels that is roughly 24px regular or 18.66px bold at the standard 96dpi reference. The rendered size after zoom and responsive rules is what matters.
Why does the checker ignore transparency?
The WCAG formula is defined for opaque colors. An rgba value must be composited against its real background first, and that background can be an image or a gradient. The tool reads the opaque base color and tells you so instead of guessing.
Does passing AA guarantee the text is accessible?
No. Contrast is one requirement among many. Font size, weight, spacing, motion, color-only meaning and screen reader structure all affect accessibility. A page can pass every contrast check and still be unusable.
Should I use APCA instead?
APCA is part of the WCAG 3 draft and is not the current standard. Audits and legal requirements still reference WCAG 2.2 contrast ratios. APCA can inform design decisions, but it cannot be claimed as WCAG 2.x conformance.
Are my colors uploaded anywhere?
No. Parsing and luminance calculations run in the browser. The page makes no network request, so the values stay on your device.