Color contrast calculator (WCAG accessibility)
Calculate the contrast ratio between two colors and see if it passes WCAG accessibility criteria.
WCAG requires 4.5:1 for normal text (AA) and 7:1 for AAA. Large text (≥18pt or 14pt bold) needs 3:1.
How the calculation works
The relative luminance of each color is computed (from RGB, with gamma correction) and the contrast ratio (L_light + 0.05) ÷ (L_dark + 0.05). The result ranges from 1:1 (identical) to 21:1 (black and white).
Examples
- Black (#000) on white (#fff): 21:1 (the maximum).
- Light gray #999 on white: ~2.8:1 → fails AA for normal text.
Frequently asked questions
What minimum contrast should I use?
Aim for 4.5:1 for normal text (level AA). For maximum legibility, 7:1 (AAA).
Does large text need less contrast?
Yes: from 18 pt (or 14 pt bold), the AA minimum drops to 3:1.
Why does contrast matter?
Low contrast is hard to read for low-vision users — and for everyone in bright sun or on poor screens. It is a WCAG accessibility requirement.
Related calculators
More Tech / IT calculators
See all →Download time
Calculate how long a file takes to download at your internet speed.
Subnet (IPv4/CIDR)
Compute network address, broadcast, mask and host count from an IP and CIDR prefix.
Password strength
Estimate password entropy (bits) and crack time from length and character types.
Number base converter
Convert numbers between binary, octal, decimal and hexadecimal. Enter the value and its base.
Password generator
Create strong, random passwords with the length and character types you choose. Generated in your browser — nothing is sent.
Pixel density (PPI)
Calculate a screen's pixels per inch (PPI) from its resolution and diagonal size.
Uptime / SLA
Find out how much downtime an uptime SLA allows per year, month, week and day.
Updated on June 30, 2026 · by Rafael Rossi · Methodology & sources