fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home/developer-tools/contrast-checker

Color Contrast Checker

Can everyone read this colour on that one?

Pick a text colour and a background. We calculate the WCAG contrast ratio, tell you which levels it passes for body text, headings and buttons, and if it fails, find the nearest shade that passes.

text colour
background
swap_vertSwap colours
try a pair
GreyBrandAlertMutedDarkWarm
contrast ratio2.53:1fails for any text
AA text≥ 4.5:1cancelAA large≥ 3:1cancelAA UI≥ 3:1cancelAAA text≥ 7:1cancelAAA large≥ 4.5:1cancellogo onlyno minimumcheck_circle
Your delivery is on its wayWe’ll send a text when the driver is 30 minutes away. You can change the drop-off spot until 8 am on the day.Small print: delivery slots are two hours long and may change during bad weather.
Track parcelChange slotnotifications
nearest passing fixes · click to use
AaText #70757Edarker text · 4.63:1AaBackground #383838darker background · 4.62:1
~/whole-palette

Check every pair in a brand palette at once.

Five colours make twenty text-on-background combinations. The grid shows which you can safely use for body text, which only for large headings, and which to avoid. Edit any swatch; click a square to load it into the checker.

text ↓ bg →
#14131f-same2.9fail4.9AA17.0AAA18.4AAA
#4f46e52.9fail-same1.7fail5.8AA6.3AA
#0d94884.9AA1.7fail-same3.5large only3.7large only
#f6f5fb17.0AAA5.8AA3.5large only-same1.1fail
#ffffff18.4AAA6.3AA3.7large only1.1fail-same
10 of 20 pairs work for body text, 4 more only for large headings or icons. The rest shouldn’t carry text at all.
~/not-just-contrast

About one man in twelve sees red and green differently.

Contrast is about lightness, so it mostly survives colour-vision differences. Meaning carried by hue alone does not: a red "error" and a green "success" can look identical. Here are your two colours and a status pair, simulated for four types of colour vision.

Typical visionmost people
Aa
errorok
text2.54:1Status colours still distinct.
Protanopiareduced red · ~1% of men
Aa
errorok
text2.52:1Same hue; told apart only by lightness. Add an icon or label.
Deuteranopiareduced green · ~1% of men
Aa
errorok
text2.55:1Red and green look alike: add an icon or label.
Tritanopiareduced blue · rare
Aa
errorok
text2.54:1Status colours still distinct.
Monochromeno colour · very rare
Aa
errorok
text2.55:1Same hue; told apart only by lightness. Add an icon or label.
~/which-bar-applies

Bigger, bolder text is allowed less contrast.

WCAG counts text as "large" from 24 px regular, or 18.7 px bold. Large text only needs 3:1 at level AA instead of 4.5:1. Move the size and weight to see which rule applies to your colours.

size16 px · normal
RegularBold
Quarterly report, page 4
counts asnormal textAA needs4.5:1AAA needs7:1
At this size your colours fail AA. Choose a stronger colour; size alone won’t fix it.
~/two-formulas

The formula the law uses, and the one that matches your eyes better.

WCAG 2's ratio is the one accessibility laws point to. It treats every colour pair the same way, so dark text on white and white text on dark score identically. APCA, the Accessible Perceptual Contrast Algorithm proposed for WCAG 3, models how contrast is actually seen. It gives a signed lightness contrast (Lc) that depends on which colour is the text. Both are computed here for the colours in the checker above.

AaOrange on whiteAaWhite on orangeAaDark grey on blackAaMid grey on whiteAaWhite on blueAaYellow on white
WCAG 2 contrast ratiosymmetric
Text on background2.53:1fails
Swapped2.53:1fails
(L1 + 0.05) / (L2 + 0.05)= (1.0 + 0.05) / (0.3636 + 0.05)= 2.53:1
Swapping text and background never changes the score. The 0.05 added to both stands in for screen flare, which is why pure black on white tops out at 21:1.
APCA lightness contrastdepends on polarity
Text on backgroundLc 49.8Lc 45+
SwappedLc -54.9Lc 45+
Y = 0.2126·R^2.4 + 0.7152·G^2.4 + 0.0722·B^2.4Y text 0.3389 · Y background 1.0dark on light: (Ybg^0.56 − Ytxt^0.57) × 1.14 − 0.027= Lc 49.77
Positive Lc is dark text on a light background; negative is light on dark. The two directions use different exponents because the eye adapts differently to each.
check_circleThe two formulas agree: both say this pair is too weak for body text.
Lc 90preferred for body text, 14-16 pxLc 75minimum for body textLc 60other content text, 24 px or 16 px boldLc 45large headings, 36 px or 24 px boldLc 30placeholders, disabled text, UI outlinesLc 15non-text dividers only

APCA here is the published 0.0.98G-4g base formula. Its full guidance adds font-size and weight lookup tables, simplified to the six levels above. APCA is still a working draft and isn't a legal standard: conformance today is measured with WCAG 2.

~/inside-the-ratio

Where 4.5:1 comes from, one channel at a time.

Screens store colour gamma-encoded, so #808080 isn't half as bright as white; it's about a fifth. The ratio first undoes that encoding, then weights green far more than blue, because the eye is most sensitive to green. Here is every step for both colours, followed by what happens when text is made semi-transparent.

colourredgreenblueluminance Y
text#9ca3af156 / 255= 0.612linear 0.3325× 0.2126 = 0.0707163 / 255= 0.639linear 0.3663× 0.7152 = 0.2619175 / 255= 0.686linear 0.4287× 0.0722 = 0.03100.3636
background#ffffff255 / 255= 1.000linear 1.0000× 0.2126 = 0.2126255 / 255= 1.000linear 1.0000× 0.7152 = 0.7152255 / 255= 1.000linear 1.0000× 0.0722 = 0.07221.0
ratio = (1.0 + 0.05) ÷ (0.3636 + 0.05) = 2.53:1
#808080 → Y 0.2159Halfway in code values is only about 22% of white’s light. The gamma curve gives dark shades more of the 256 steps.
#757575 → 4.55:1 on black, 4.60:1 on whiteThe best-balanced grey. No grey does better than about 4.58:1 against both black and white, so only a narrow band of mid greys passes AA with both text colours, and none reaches AAA 7:1 with both.
#767676 → 4.54:1The lightest grey that passes AA on white. One step lighter, #777777, scores 4.47:1 and fails.
Semi-transparent textDesigners often fade secondary text with opacity. Checkers that read only the CSS colour see the full-strength value. What matters is the colour that actually lands on screen after blending with the background.
text opacity60%
Secondary label textcolor: #9ca3af; opacity: 0.6
colour on screen#c4c8cf1.67:1Without opacity the pair scores 2.53:1. At 60% the text blends to #c4c8cf.
~/reference

Every WCAG 2.2 rule that involves colour.

The success criteria an audit checks, with the colours from the checker tested against each where a ratio applies. Level AA is what most laws require, including the European Accessibility Act and the US ADA Title II rule.

SCnamelevelneedswhat it coversyour colours
1.4.1Use of ColorA-Colour is never the only way information is shown: links in text, form errors and chart series need a second cue.manual check
1.4.3Contrast (Minimum)AA4.5:1Text and images of text. Large text needs 3:1. Logos and inactive controls are exempt.fail 2.5
1.4.3Large textAA3:1At least 24 px (18 pt), or 18.66 px (14 pt) bold.fail 2.5
1.4.6Contrast (Enhanced)AAA7:1The stricter version; large text needs 4.5:1.fail 2.5
1.4.11Non-text ContrastAA3:1Input borders, icons, focus rings and chart parts against adjacent colours.fail 2.5
1.4.8Visual PresentationAAA-Users can choose their own foreground and background colours for blocks of text.manual check
2.4.7Focus VisibleAA-Keyboard focus is always visible.manual check
2.4.11Focus Not ObscuredAA-New in 2.2: the focused element isn’t hidden behind sticky headers or banners.manual check
2.4.13Focus AppearanceAAA3:1New in 2.2: a focus indicator at least 2 px thick, with 3:1 between its focused and unfocused states.fail 2.5
24 pxLarge text, regular18 pt in WCAG’s print-based definition, at the CSS rate of 96 px per inch.
18.66 pxLarge text, bold14 pt bold. Weights of 700 and up count as bold; 600 depends on the font.
21:1The maximumPure black on pure white: (1 + 0.05) ÷ (0 + 0.05). The minimum, any colour on itself, is 1:1.

From WCAG 1.0 to APCA

1999WCAG 1.0Asks for “sufficient contrast” without defining a number.
2008WCAG 2.0Introduces the luminance ratio and the 4.5:1, 3:1 and 7:1 thresholds.
2016EN 301 549The European procurement standard adopts WCAG 2.0 AA wholesale.
2018WCAG 2.1Adds 1.4.11 Non-text Contrast for icons, borders and controls.
2019APCA developmentAndrew Somers begins the perceptual contrast model proposed for WCAG 3.
2023WCAG 2.2Adds focus appearance and obscuring criteria; contrast thresholds unchanged.
2024ADA Title II ruleUS state and local government websites must meet WCAG 2.1 AA, phased in from 2026.
2025European Accessibility ActFrom 28 June, products and services sold in the EU must meet EN 301 549.