Color Contrast Checker (WCAG)

Check WCAG 2.1 AA/AAA color contrast ratios for text, large text, and UI components. Live previews, APCA reference, accessible pair finder, and favorites.

Updated

Share:
Home/Color Contrast Checker (WCAG)

Color Contrast Checker (WCAG)

Check color contrast ratios against WCAG 2.1 AA/AAA guidelines. Pick foreground and background colors, preview live text samples, and find accessible pairs.

Foreground
Text

Background
Surface

Contrast ratio

14.68:1

APCA Lc 101.5 (reference)

AAA

AA Normal text

Requires 4.5:1

Pass

AA Large text

Requires 3:1

Pass

AAA Normal text

Requires 7:1

Pass

AAA Large text

Requires 4.5:1

Pass

AA UI Components

Requires 3:1

Pass

Frequently Asked Questions

What ratio do I need?

WCAG 2.1 AA requires 4.5:1 for normal text, 3:1 for large text (18pt or 14pt bold). AAA requires 7:1 and 4.5:1. UI components need >= 3:1.

How is the ratio calculated?

sRGB is gamma-corrected to linear, then relative luminance = 0.2126R + 0.7152G + 0.0722B. Ratio = (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter.

What is APCA?

Accessible Perceptual Contrast Algorithm (for WCAG 3) — accounts for text weight, polarity, and spatial frequency. Shown as reference; WCAG 2 ratios remain the normative standard today.

Is the Color Contrast Checker (WCAG) free to use?

Yes, the Color Contrast Checker (WCAG) is 100% free with no registration, no hidden fees, and no usage limits. All processing happens locally in your browser, ensuring complete privacy.

Is my data safe with this tool?

Absolutely. The Color Contrast Checker (WCAG) processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.

Does the Color Contrast Checker (WCAG) work on mobile devices?

Yes, the Color Contrast Checker (WCAG) is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.

Do I need to create an account to use this tool?

No account or registration is needed. Simply open the Color Contrast Checker (WCAG) in your browser and start using it immediately. There are no sign-up walls or usage restrictions.

What programming languages or formats does this support?

The Color Contrast Checker (WCAG) supports a wide range of popular formats and languages. Check the tool interface for the full list of supported options.

How do I use the Color Contrast Checker (WCAG)?

Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.

Which browsers are supported?

The Color Contrast Checker (WCAG) works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.

What counts as large text for WCAG contrast rules?

Under WCAG 2.1, large text is anything 18pt and above, or 14pt and above when bold. Because design tools work in pixels, that translates to roughly 24px regular or about 18.66px (commonly rounded to 18.5px or 19px) bold. Large text only needs a 3:1 contrast ratio for AA and 4.5:1 for AAA, while normal body text needs the stricter 4.5:1 and 7:1. The reasoning is simple: bigger, heavier letterforms have thicker strokes, so they stay legible at lower contrast. This distinction matters because a heading color that passes at 24px can fail outright in 16px body copy. This checker reports the ratio against every threshold at once, so you can see whether your pair clears the normal-text bar or only qualifies as large text.

Why does the same color pass on a heading but fail on body text?

It comes down to which WCAG threshold applies to each font size. A heading rendered at 24px or larger (or 18.66px bold) is treated as large text and only needs a 3:1 ratio, while body copy below that size is normal text and must reach 4.5:1. So a foreground and background that produce, say, a 3.5:1 ratio will earn a Pass badge for the heading but a clear Fail for the paragraph using the identical colors. The ratio itself never changes with font size, only the bar it has to clear. That is why a color scheme can look approved in your hero section yet quietly fail in captions and labels. This tool renders both 16px and 24px samples in the Preview tab and lists every threshold, so you immediately see where a pair holds up and where it breaks.

How do I fix text that fails the contrast check without changing the whole design?

You usually only need to nudge the lightness of one color rather than rebuild your palette. The fastest path is to darken the text or lighten the background (or vice versa) in small steps until the ratio crosses 4.5:1, keeping the original hue intact so the brand feel survives. This checker has dedicated Darken and Lighten buttons that shift a color's lightness incrementally while preserving its hue, and the ratio updates live so you can stop the moment a Pass appears. A Swap button flips foreground and background to test the inverse pairing, which sometimes passes when the original does not. If you would rather start fresh, the Random accessible pair button generates a combination that already clears 4.5:1, giving you a compliant baseline to adjust from.

Can I enter colors in HEX, RGB, and HSL, and do they stay in sync?

Yes. You can type a 3- or 6-digit HEX value, set individual RGB channels from 0 to 255, adjust HSL hue, saturation, and lightness, or use the native color picker, and all four representations update together automatically. Changing any one input recalculates the others, so a tweak to a single RGB channel is instantly reflected in the HEX and HSL fields and in the live contrast ratio. This matters because design specs and code arrive in mixed formats: a brand guide might list HEX, a CSS file might use rgb(), and a design tool might expose HSL sliders. Keeping them synchronized means no manual conversion or copy-paste errors. When a pair works, the Copy as CSS vars button hands you a ready-to-paste :root block with foreground and background custom properties for your stylesheet.

Do icons, buttons, and input borders have to meet the same contrast ratio as text?

No, they follow a separate, lower threshold. WCAG 2.1 Success Criterion 1.4.11, Non-text Contrast, requires only 3:1 contrast for user interface components and meaningful graphics, including input borders, icons, toggle states, and focus indicators, measured against their adjacent colors. That is the same bar as large text, not the 4.5:1 required for normal text. The idea is that a button outline or an icon does not need to be as crisp as a paragraph to remain perceivable, but it still must be distinguishable. A common failure is a pale gray input border that disappears against a white form. This checker lists the UI components and graphics threshold alongside the text levels and renders a button and a bordered card in the Preview tab, so you can confirm interactive elements are visible, not just the words.

Embed This Tool

Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.

Copy & paste this HTML
<iframe src="https://getthetoolbox.com/embed/color-contrast" title="Color Contrast Checker (WCAG) — The Toolbox" width="100%" height="280" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/developer-tools/color-contrast?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free Color Contrast Checker (WCAG)</a> by The Toolbox</p>

About the Color Contrast Checker

The Color Contrast Checker measures the contrast ratio between a text (foreground) color and its background, then tells you whether that pair meets the WCAG 2.1 accessibility guidelines. Pick a foreground and a background, and the tool instantly reports the ratio and a pass/fail verdict for each conformance level. It's built for designers, front-end developers, and accessibility reviewers who need to know — before shipping — whether their colors are legible to people with low vision or color deficiencies.

Everything runs locally in your browser. No colors are uploaded to a server, there's no sign-up, and there are no usage limits. Even your saved favorites are kept in your browser's local storage, not on any server.

How contrast ratio is measured

Contrast ratio is a number from 1:1 (identical colors) to 21:1 (pure black on pure white). The tool follows the WCAG 2.1 formula exactly: each sRGB color is gamma-corrected to linear light, its relative luminance is computed as 0.2126·R + 0.7152·G + 0.0722·B, and the ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter of the two luminances. The result updates live and is shown to two decimal places, so a near-miss like 4.48:1 is easy to spot.

You can enter colors in whatever format you already have. Type a HEX value (3- or 6-digit), nudge individual RGB channels from 0–255, adjust HSL hue/saturation/lightness, or use the native color picker. All four stay in sync.

Which WCAG levels you need to hit

The checker tests your pair against the five thresholds that the guidelines actually define:

  • AA normal text — at least 4.5:1. This is the baseline for body copy and the level most accessibility audits and legal requirements reference.
  • AA large text — at least 3:1. "Large" means 18pt (24px) or 14pt (about 18.66px) bold and above.
  • AAA normal text — at least 7:1, the enhanced standard.
  • AAA large text — at least 4.5:1.
  • UI components and graphics — at least 3:1 for things like input borders, icons, and focus indicators.

Each row shows a clear Pass or Fail badge, and a headline label summarizes the best level the pair reaches (AAA, AA, AA Large, or Fail). The tool also displays an APCA Lc value as a reference. APCA (the Accessible Perceptual Contrast Algorithm) is the contrast method being developed for the future WCAG 3, and it accounts for text weight and polarity in ways the ratio formula does not — but WCAG 2 ratios remain the normative standard for compliance today.

Fixing a failing pair quickly

When a combination falls short, you rarely need to start over. The Darken and Lighten buttons shift a color's lightness in small steps so you can push it just past a threshold while keeping the hue. Swap flips foreground and background to test the inverse, and Random accessible pair generates a fresh combination that already clears 4.5:1 when you need a quick accessible starting point.

A live Preview tab renders your colors on real samples — 16px body text, 24px large text, 18px bold, small 12px text, a button, and a bordered card — plus an inverted version, so you can judge legibility with your own eyes rather than trusting the number alone. Once a pair works, Copy as CSS vars puts a ready-to-paste :root { --fg; --bg; } block on your clipboard, and Save favorite keeps the pair (with its ratio) in a list you can reload later.

Why it matters

Poor contrast is one of the most common and most easily fixed accessibility failures on the web. Low-contrast text strains everyone, but it can make content genuinely unreadable for people with reduced vision or color blindness, and it's a frequent flag in WCAG audits and procurement checklists. Checking a pair takes seconds here; fixing it after launch across a whole design system takes far longer.