Tools

Home
Regex TesterHash GeneratorURL Encode/DecodeEncrypt/DecryptJSON Path TesterFavicon Downloader

Color Contrast Checker (WCAG)

Test foreground and background color pairs against WCAG AA and AAA accessibility standards — instant contrast ratio and pass/fail results

Your files never leave your browser
Foreground (Text) Color
Background Color
21:1
Contrast Ratio
LevelTypeMinimumResult
AANormal text4.5:1PASS
AALarge text3:1PASS
AAANormal text7:1PASS
AAALarge text4.5:1PASS
Large text (24px bold) — Heading exampleNormal text (16px) — This is body copy at standard size to check legibility.Small text (12px) — Caption, footnote, or fine print that is harder to read at reduced size.
Failing AA — suggested foreground colors that pass:

Drop in two hex colors and instantly see whether your text-background pair meets WCAG AA or AAA contrast thresholds. The tool shows the exact ratio, flags pass or fail for normal and large text, and suggests alternative foreground colors when your combo falls short.

And everything runs in your browser. Nothing gets uploaded.

How It Works

Pick Two Colors
➔
Calculate Luminance Ratio
➔
WCAG Pass / Fail

The tool converts each hex color to its relative luminance (a measure of perceived brightness, weighted toward how human eyes respond to red, green, and blue). It divides the lighter luminance by the darker one to get a ratio between 1:1 and 21:1. WCAG 2.1 says normal text needs at least 4.5:1 for AA, and 7:1 for AAA. Large text gets a break — 3:1 for AA.

Examples

Dark Gray Text on White — The Safe Default

You're building a blog and want body text that feels softer than pure black but still passes every WCAG level.

INPUT
Foreground: #333333 Background: #FFFFFF
OUTPUT
Ratio: 12.63:1 AA Normal: PASS AAA Normal: PASS

Brand Orange on White — Trickier Than It Looks

Marketing wants orange buttons with white text. Looks bold, right? The contrast ratio tells a different story.

INPUT
Foreground: #FFFFFF Background: #FF8C00
OUTPUT
Ratio: 2.95:1 AA Normal: FAIL AA Large: FAIL (barely) Suggested fix: #9A5500

Navy on Light Blue — Subtle Background Combos

Info banners often pair navy text with a pale blue box. Quick check confirms it works.

INPUT
Foreground: #1E3A5F Background: #DBEAFE
OUTPUT
Ratio: 8.41:1 AA Normal: PASS AAA Normal: PASS

Who Uses This

👨‍💻 Front-End Developers

Validate text and button colors against WCAG before pushing to production.

🎨 UI Designers

Test color palette combos in Figma, then confirm ratios here before handoff.

♻️ Accessibility Auditors

Spot-check live pages for WCAG 2.1 AA and AAA compliance during audits.

📈 Product Managers

Verify brand colors actually work for body text before approving a style guide.

Common Mistakes

Only testing on a high-end display

Your Retina screen makes everything look crisp. A $200 office monitor washes colors out badly. If the ratio is right at 4.5:1, bump it up a notch to account for cheaper screens.

Confusing AA Large with AA Normal

Large text (18px+ bold, or 24px+ regular) only needs 3:1. Normal text needs 4.5:1. People see "PASS" for large text and assume the whole page is fine — then small captions and footnotes fail.

Ignoring semi-transparent colors

RGBA or HSLA colors with opacity depend on whatever sits behind them. The actual rendered color changes with the background. Convert to a flat hex value first (use a color picker on a screenshot), then check that.

Technical Details

Frequently Asked Questions

What is a good contrast ratio for text?

For normal-sized body text, aim for at least 4.5:1 — that's the WCAG AA minimum. If you want AAA (the highest level), you need 7:1. Large text like headings can get by with 3:1 for AA. Most readable websites land somewhere between 7:1 and 12:1 for body copy.

What's the difference between WCAG AA and AAA?

AA is the standard most laws and guidelines reference — it's what you need to meet for ADA and EU accessibility compliance. AAA is stricter and harder to hit with colorful brand palettes. Most teams target AA across the board and aim for AAA where they can.

Does color contrast matter for images and icons?

WCAG 2.1 added a requirement for non-text contrast (Success Criterion 1.4.11). UI components like icons, form borders, and focus indicators need at least 3:1 against their background. Decorative images are exempt, but anything functional is not.

Why does my color fail even though it looks fine to me?

Your eyes adapt to your specific screen brightness and surrounding light. Someone with color vision deficiency, an older display, or sunlight glare on their phone won't have that advantage. The math doesn't care about your monitor — it measures the gap between two color values objectively.

Can I check contrast for colors that aren't hex?

This tool takes hex codes. If you have RGB values like rgb(100, 50, 200), convert each number to hex first — or just use the color picker built into the tool and click the exact shade you want. HSL and named CSS colors work the same way: convert to hex, then paste.

Share: