Contrast Checker

Check color contrast ratios for accessibility. Ensure your colors meet WCAG guidelines.

Foreground (Text)

RGB: rgb(0, 0, 0)
HSL: hsl(0, 0%, 0%)

Background

RGB: rgb(255, 255, 255)
HSL: hsl(0, 0%, 100%)

Preview

Large Text (24px+)
Normal text looks like this. Make sure it's readable!

Contrast Ratio

21.00:1
WCAG Contrast Ratio

WCAG Compliance

WCAG AAβœ“ Pass
Normal Text (under 18px):βœ“ Pass (4.5:1+)
Large Text (18px+ or 14px bold):βœ“ Pass (3:1+)
WCAG AAAβœ“ Pass
Normal Text:βœ“ Pass (7:1+)
Large Text:βœ“ Pass (4.5:1+)

Quick Fixes

βœ“ Good contrast!
This color combination passes WCAG AA standards.

CSS Code

/* Text Color */
color: #000000;

/* Background Color */
background-color: #FFFFFF;

/* Contrast Ratio */
21.00:1

Not sure which ratio you need?

Normal text needs 4.5:1, large text and UI components need 3:1, and focus rings need 3:1 with a 2px perimeter. The Color Accessibility Hub maps each check to its WCAG success criterion, with a 10-point audit checklist and copy-paste token fixes.

WCAG Contrast Checker for Accessible Design Decisions

Check text and background combinations against the WCAG 2.2 thresholds that auditors actually cite: 4.5:1 for normal text (SC 1.4.3), 3:1 for large text and UI components (SC 1.4.11), 7:1 for AAA, and 3:1 for focus indicators (SC 2.4.13). Everything runs in the browser with no signup, so you can validate tokens during design review, before a PR merges, or while responding to an accessibility audit.

How to Use

  1. 1Enter or pick your foreground and background colors to compare the combination.
  2. 2Read the ratio, then check it against the threshold for that element: 4.5:1 normal text, 3:1 large text and UI components, 7:1 for AAA.
  3. 3If it fails, adjust lightness rather than hue. Darkening the text usually costs less brand identity than shifting the color.
  4. 4Re-test every interactive state separately: hover, active, focus ring, and disabled. Default state passing does not mean the component passes.
  5. 5Repeat the whole pass on your dark theme surface. Inverted light-mode tokens frequently fail on dark backgrounds.

Features

  • βœ“Free accessibility tool with no registration or login required.
  • βœ“Runs fully in the browser for quick checks during design and development.
  • βœ“Real-time contrast feedback as soon as either color changes.
  • βœ“Reports AA and AAA results separately for normal and large text, so you can cite the exact success criterion in an audit response.
  • βœ“Shows HEX, RGB, and HSL values for both colors, which makes it easy to log the failing token and its replacement.
  • βœ“Includes a swap control for testing the same pair in reverse polarity, useful when the same token is used for both text and background.

Common gray text tokens: measured ratios on white

Muted and secondary text is the single most common contrast failure in production UI. These are the default gray scales most teams reach for, measured against #FFFFFF with the WCAG 2.2 relative luminance formula. Anything below 4.5:1 cannot carry body text.

TokenHexRatio on whiteNormal text (4.5:1)Safe use
gray-300#D1D5DB1.47:1FailBorders on dark surfaces only, never text
gray-400#9CA3AF2.54:1FailDecorative dividers, disabled non-essential text
gray-500#6B72804.83:1Pass (AA)Placeholder and helper text, minimum safe gray
gray-600#4B55637.56:1Pass (AAA)Muted body copy and secondary labels
blue-600#2563EB5.17:1Pass (AA)Links, primary button fill, focus rings
red-500#EF44443.76:1FailIcon fills only, not error message text
red-700#B91C1C6.47:1Pass (AA)Error text and danger button fills

Ratios computed with the WCAG 2.2 relative luminance formula against #FFFFFF. gray-400 at 2.54:1 is the token that most often ships as "subtle" body text and fails audit. Verify your own surface color above, since a tinted background changes every value.

Go deeper on color accessibility

Frequently Asked Questions

Why is a contrast checker important for designers and developers?

Color contrast has a direct effect on readability, usability, and accessibility compliance. Designers use it to avoid attractive but hard-to-read combinations, while developers use it to confirm that product decisions still work in real interfaces. A quick contrast check helps teams catch issues early instead of finding them late during QA or accessibility review.

What does it mean if a color pair passes AA but not AAA?

A pass at AA means the combination meets a commonly accepted accessibility threshold for many text scenarios, while AAA is stricter and aims for even stronger readability. In practice, teams often target AA as a baseline and use AAA where possible for critical content, dense interfaces, or audiences that benefit from higher visual clarity.

Can I use this when building a design system?

Yes, and it is especially valuable there. Contrast checking helps validate primary text colors, secondary labels, status badges, links, and themed surfaces before those choices spread across many components. Designers can create more reliable tokens, and developers can map approved combinations into reusable variables or utility classes with greater confidence.

Does the tool replace manual accessibility testing?

Not entirely. It is an excellent first check for color contrast, but accessibility also depends on factors like text size, weight, spacing, context, and interaction patterns. Teams should use the tool as part of a broader workflow that includes design review, implementation testing, and, when possible, real user feedback or formal accessibility audits.

Do I need to upload any files or create an account?

No. The checker is free, browser-based, and available without registration. That makes it easy to use during everyday design and development work, whether you are reviewing a mockup, testing a CSS update, or checking brand colors before publishing a new landing page or product feature.

My gray text token is gray-400 (#9CA3AF) β€” why does it fail?

It measures 2.54:1 against white, which is below the 4.5:1 threshold for normal text (WCAG 2.2 SC 1.4.3). This is the most common gray in design systems and the #1 token that ships as "subtle" body text and fails audits. If your background surface is not pure white, test your exact pair above. Otherwise, replace gray-400 with gray-500 (#6B7280) or gray-600 (#4B5563) for body text, and keep gray-400 for decorative dividers or non-essential disabled states.

What ratio do focus indicators need?

WCAG 2.2 SC 2.4.13 Focus Appearance requires focus indicators to have at least 3:1 contrast against adjacent colors and a minimum area equal to a 2px perimeter around the component. The focus ring color should be distinct from the fill (not an opacity variant) and should never rely on color alone to indicate focus. Test your focus ring with the checker by placing the ring color in the foreground and the surface color in the background.

Do I need different contrast in dark mode?

The WCAG ratios (4.5:1, 3:1) apply equally to dark and light mode, but most dark-mode failures happen because teams simply invert light-mode tokens. Build a separate dark token set and test each state independently. Common failure: a light-mode gray that passes on white becomes invisible on a dark surface when inverted. Verify each token pair against the actual background color, not a placeholder.

I got a notice from the accessibility team β€” how do I fix it fast?

Three-layer rapid response. First, run Chrome DevTools β†’ More tools β†’ CSS Overview β†’ Capture β†’ Colors section to export every text/background combination sorted by lowest contrast. Second, use the Contrast Checker above to measure and find replacements for failing pairs β€” adjust lightness, not hue, to preserve brand. Third, add the approved pairs to your design tokens and commit them as a PR. If the report mentions specific pages, audit them with axe DevTools or Stark before shipping. Most organizations accept a 48-hour fix window for contrast failures if you can show a clear audit trail.