🧰 ToolPicoAll Tools →

Color Contrast Checker (WCAG AA/AAA)

Enter two colors and see the WCAG 2.x contrast ratio instantly. Get AA/AAA pass/fail for normal text, large text, and UI components, an APCA (Lc) perceptual contrast score, a live preview, colorblindness simulation, semi-transparent (alpha) color support, and an automatic accessible color suggestion when a pair fails.

AA normal 4.5:1 AAA normal 7:1 Large text / UI 3:1 Updated: Jul 19, 2026
Type hex (#7c3aed), rgb(124,58,237), or hsl(262,83%,58%). For transparency use rgba/hsla or 8-digit hex (e.g. #7c3aed80).
Enter any format — it's detected automatically.
⚙️ Advanced settings — suggestion target and adjustable color
Enter 4 colors; the tool shows the WCAG contrast ratio of every pairwise combination in a matrix (audit your brand palette at once).
Copy color pair as code

        
      
Quick answer A WCAG contrast ratio is calculated by comparing the relative luminance of two colors, giving a value between 1:1 and 21:1. Normal text needs at least 4.5:1 for AA, while large text and UI components need at least 3:1; AAA raises these to 7:1 and 4.5:1. Enter two colors above to get the result and a suggestion instantly.
4.5:1AA normal text
3:1AA large text / UI
7:1AAA normal text
21:1Maximum (black/white)
⚠️ Accuracy note: The contrast ratio is calculated instantly in your browser using WCAG 2.x's official relative luminance formula; no data is sent to a server. The colorblindness preview uses commonly used approximate transformation matrices (protanopia/deuteranopia/tritanopia/achromatopsia) and is a simulation, not a medical diagnostic tool. "Large text" follows the WCAG definition: 18pt+ normal weight or 14pt+ bold.

What is color contrast, and how does WCAG measure it?

A complete explanation of the relative luminance formula, AA/AAA thresholds, and practical tips for choosing accessible colors.

Color contrast is a numeric measure of how "distinguishable" a text (foreground) is from its background. The Web Content Accessibility Guidelines (WCAG) 2.x standardize this measure so text stays readable even for people with visual impairment, age-related vision loss, or poor lighting conditions. The result is a single number between 1:1 (colors are identical, no contrast) and 21:1 (pure black/white, maximum contrast).

How is color contrast calculated? (the relative luminance formula)

Quick answerFirst, each color's R, G, B channels are normalized to 0-1 and converted to a linear value with gamma correction. These three linear values are summed with the weights 0.2126×R + 0.7152×G + 0.0722×B to get the relative luminance (L). The contrast ratio is found with (L_lighter + 0.05) / (L_darker + 0.05).
  • Step 1 — sRGB normalize: for each channel c, c' = c/255.
  • Step 2 — gamma correction: if c' ≤ 0.03928, c_lin = c'/12.92; otherwise c_lin = ((c'+0.055)/1.055)^2.4.
  • Step 3 — relative luminance: L = 0.2126·R_lin + 0.7152·G_lin + 0.0722·B_lin.
  • Step 4 — ratio: add 0.05 to the higher L and the lower L, then divide: (L1+0.05)/(L2+0.05), with L1>L2.

The green channel has the highest weight (0.7152) because the human eye is most sensitive to green; the blue channel (0.0722) has the lowest weight. That's why pure red, green, and blue at the same "brightness" produce different contrast ratios.

What's the difference between AA and AAA accessibility?

Quick answerAA is WCAG's minimum (and most commonly required) level: normal text needs 4.5:1, large text and UI components need 3:1. AAA is the enhanced level: normal text needs 7:1, large text needs 4.5:1. AAA isn't always practical for every design, but it's preferred for critical content (e.g. health information, official forms).
WCAG 2.x contrast threshold summary
Content typeAA (minimum)AAA (enhanced)
Normal text (below 14pt/18.66px, unless bold)4.5:17:1
Large text (18pt/24px+ or 14pt/18.66px+ bold)3:14.5:1
UI component / graphical object boundary3:1not defined
Decorative / disabled elementsnot requirednot required

What does a 4.5:1 contrast ratio mean?

Quick answer4.5:1 is the minimum ratio WCAG AA requires for normal-size text. For example, medium gray #767676 on white (#FFFFFF) barely clears this bar at roughly 4.54:1 — a classic "boundary" example frequently cited in WCAG documentation. A slightly lighter gray (e.g. #999) usually drops below 4.5:1 and fails AA.

How do I choose accessible colors?

Quick answerAim for at least AA (4.5:1 normal text / 3:1 large text) in every text/background pair; don't rely on color alone for meaning (e.g. add an icon or bold text next to red for an error message); darken or lighten your brand color's lightness to raise contrast; and check color pairs that might be confused, like red-green, with a colorblindness simulation.

Practical tip: a brand's primary color (e.g. purple #7c3aed) usually doesn't have enough contrast as text on white, but it can work well as a background with white text — that's why it's useful to test the same color as both text and background.

How do I test website contrast?

Quick answerEnter every text/background and button/icon pair from your site into the tool above and check the AA/AAA result; to compare several brand colors at once, use the Palette Check tab — it shows every pairwise combination of 4 colors in one table.

Example color pairs and contrast ratios

Real, calculated WCAG contrast ratios for commonly used color pairs — use these as a reference for your own colors.

Example pairs (foreground / background) and their calculated contrast ratio
ForegroundBackgroundRatioAA normalAAA normal
#000000#FFFFFF21.00:1
#111528#F5F7FC16.86:1
#1E293B#F1F5F913.35:1
#FFFFFF#7C3AED5.70:1
#DB2777#FFFFFF4.60:1
#767676#FFFFFF4.54:1✓ (boundary)
#0D9488#FFFFFF3.74:1Large text only
#FFFF00#FFFFFF1.07:1

Explore all ToolPico tools →

WCAG reference tables

Citable thresholds, the "large text" definition, and colorblindness types.

WCAG 2.x minimum contrast ratio thresholds
LevelNormal textLarge textUI component
AA4.5:13:13:1
AAA7:14.5:1not defined

Source: W3C WCAG 2.2, Success Criterion 1.4.3 (Contrast Minimum) and 1.4.11 (Non-text Contrast).

"Large text" definition
WeightMinimum size
Normal weight18pt (≈24px)
Bold14pt (≈18.66px)

Anything below these sizes falls under the "normal text" threshold (4.5:1 / 7:1).

Common colorblindness types
TypeAffected color perceptionApprox. prevalence
ProtanopiaWeak/absent red perception~1% of men
DeuteranopiaWeak/absent green perception~1% of men
TritanopiaWeak blue-yellow distinction~0.01% (rare)
AchromatopsiaNo color perception (grayscale)Very rare

Red-green colorblindness (protanopia + deuteranopia) together affects about 8% of men and 0.5% of women.

Contrast & accessibility terms glossary

Short definitions of the core terms used on this page.

Contrast ratioThe difference between two colors' relative luminance; a number between 1:1 (none) and 21:1 (maximum).
Relative luminance (L)A color's relative brightness value, found from the weighted sum of its gamma-corrected RGB channels.
WCAGWeb Content Accessibility Guidelines — the W3C's web accessibility standard.
AA levelWCAG's minimum (most commonly required) compliance level; 4.5:1 for normal text.
AAA levelWCAG's enhanced compliance level; 7:1 for normal text.
Large text18pt+ normal weight or 14pt+ bold text; accepts a lower contrast threshold (3:1/4.5:1).
UI component contrastThe minimum 3:1 contrast (WCAG 1.4.11) required between non-text elements like button borders, icons, and form fields and their background.
sRGBThe standard color space for displays; each channel is 0-255, encoded with a gamma curve.
Gamma correctionThe mathematical step that converts sRGB's non-linear encoding into a linear light value.
Colorblindness (color vision deficiency)Difficulty distinguishing certain colors; the most common form is red-green (protanopia/deuteranopia).
Lightness (L, HSL)A color's lightness/darkness value in the HSL model; typically shifted to increase contrast.
Palette contrast matrixA table showing the contrast ratio of every pairwise combination among several colors.

In-depth guides

The most frequently asked questions about color contrast and accessibility.

What to do when your brand colors fail contrast

If you find your brand color (e.g. purple #7c3aed) doesn't have enough contrast as text on white, first decide which color is adjustable — usually the background stays fixed while the text color is darkened or lightened. You can change this in "Advanced settings → Color to adjust in suggestion".

The tool shifts only the lightness (L) value while keeping the same hue and saturation, so the suggested color stays as close as possible to your brand. You can also choose whether the target is AA or AAA.

How to test a design for colorblind users

Red-green colorblindness (protanopia/deuteranopia) affects roughly 8% of men; for these users, designs like "success = green, error = red" can be especially confusing. The colorblindness strip on this page shows how your chosen color pair is perceived under four different vision types.

Practical rule: color should always be backed by a second signal (icon, underline, bold text, text label); never rely on color alone. This is WCAG's "Use of Color" (1.4.1) criterion.

How to check your entire brand palette at once

Enter 4 of your brand colors (e.g. main text, background, primary brand color, secondary accent color) in the Palette Check tab above. The tool shows every pairwise combination of these 4 colors (6 pairs) in a matrix, coloring each cell with the contrast ratio and whether it passes the AA normal-text threshold.

This quickly shows which color pairs in your design system can safely be used as text, and which should stay purely decorative.

Add this checker to your site (embed code)

Embed the color contrast checker on your own website for free. Copy the code below into your HTML — the tool runs in a simplified view and links back to this page as its source.

The embedded tool has a fixed layout; you can adjust the height value to fit your site. No ads or personal data, runs entirely client-side.

Frequently asked questions

What is WCAG contrast ratio?
WCAG contrast ratio expresses the difference between two colors' relative luminance as a number between 1:1 (same color) and 21:1 (pure black/white). It's defined in the W3C's Web Content Accessibility Guidelines so users with visual impairment can still read content.
How is color contrast calculated?
Each color's sRGB channels are converted to a linear value with gamma correction; these values are summed with weights 0.2126×R + 0.7152×G + 0.0722×B to get relative luminance (L). The contrast ratio is calculated as (L_lighter + 0.05) / (L_darker + 0.05).
What's the difference between AA and AAA accessibility?
AA is the minimum level: normal text 4.5:1, large text/UI 3:1. AAA is the enhanced level: normal text 7:1, large text 4.5:1. Most sites target AA; AAA is stricter and preferred for critical content.
What does a 4.5:1 contrast ratio mean?
4.5:1 is the minimum ratio WCAG AA requires for normal-size text. Medium gray #767676 on white barely clears this bar at roughly 4.54:1 — a classic "boundary" example that's frequently cited.
How do I choose accessible colors?
Aim for at least AA (4.5:1 normal text / 3:1 large text) in every text/background pair, don't rely on color alone for meaning, shift your brand color's lightness to raise contrast, and check risky pairs with a colorblindness simulation.
How do I test website contrast?
Enter every text/background and button/icon pair from your site into this tool as hex, rgb(), or hsl() and check the AA/AAA result. To compare several brand colors at once, use the Palette Check tab.
What is "large text", and why is its threshold different?
In WCAG, large text is 18pt (≈24px) normal weight or 14pt (≈18.66px) bold. Since larger characters are easier to read, WCAG accepts a lower threshold for them (AA 3:1, AAA 4.5:1).
What should I watch out for with colorblind users?
Red-green colorblindness affects roughly 8% of men and 0.5% of women. Avoid relying on color alone for meaning, and add an icon, pattern, or label. The colorblindness strip in this tool shows how your color pair is perceived under four vision types.
What is APCA (Lc) contrast, and how does it differ from the WCAG 2 ratio?
APCA (Accessible Perceptual Contrast Algorithm) is a perceptual contrast method developed for the WCAG 3 draft, expressed as an Lc value (roughly 0-108). Unlike WCAG 2's ratio-based formula, APCA accounts for polarity (whether text sits on a light or dark background), size, and weight. As a rule of thumb, Lc 75 is a minimum for body text, Lc 60 for larger content text, and Lc 45 for large headings. WCAG 2 answers "does it pass an audit?", APCA answers "can people actually read it?" — this tool shows both.
How is semi-transparent (alpha) text contrast calculated?
A semi-transparent text color's true contrast is found by compositing it over the background (alpha compositing): effective color = foreground × alpha + background × (1 − alpha). This tool reads the alpha from rgba(), hsla(), and 8-digit hex input (e.g. #7c3aed80), composites the text over the background, and computes the WCAG + APCA contrast of the resulting real color. This gives accurate readability for glass effects, overlays, and semi-transparent UI.
Can I pick a color directly from my screen?
Yes — on Chromium-based browsers (Chrome, Edge, etc.) a small 💧 eyedropper button appears next to the color pickers. Click it to sample any pixel on your screen and the color is inserted automatically. It relies on the native EyeDropper API, so the button is hidden automatically on browsers that don't support it (e.g. Safari, Firefox).
Can I export the color pair as CSS variables or a Tailwind config?
Yes — click Copy as code below the result card, choose CSS variables (a :root block with --contrast-fg / --contrast-bg) or Tailwind config (a theme.extend.colors snippet), then click Copy snippet to copy it straight into your codebase.

Methodology & sources

ToolPico's Color Contrast Checker is a free, independent tool. The calculation engine applies the W3C's official relative luminance formula directly in your browser: sRGB → gamma correction → linear luminance → contrast ratio. No data is ever sent to a server; every calculation runs client-side. The colorblindness simulation uses commonly used approximate transformation matrices and is intended for educational purposes.

Sources: W3C Web Content Accessibility Guidelines (WCAG) 2.2, Success Criterion 1.4.3 (Contrast Minimum), 1.4.6 (Contrast Enhanced), and 1.4.11 (Non-text Contrast). Last updated: July 19, 2026. Results are for informational and educational purposes only; the colorblindness simulation is not a medical diagnostic tool.

🔗 Add this tool to your site

Copy the code below into your own site. The tool is free, always up to date, and runs entirely on your page. No sign-up required.

Preview →
⚡ Built with ToolPico · toolpico.com