A11yColor
Color Contrast Calculator
Pick two colors — see if they pass WCAG accessibility contrast requirements.
WCAG contrast ratios for text on white
Contrast ratio runs from 1:1 to 21:1. WCAG AA needs 4.5:1 for body text and 3:1 for large text; AAA needs 7:1 and 4.5:1.
| Foreground | Background | Ratio | AA normal | AA large | AAA normal | AAA large |
|---|---|---|---|---|---|---|
| #000000 | #FFFFFF | 21.00:1 | Pass | Pass | Pass | Pass |
| #595959 | #FFFFFF | 7.00:1 | Pass | Pass | Pass | Pass |
| #0066CC | #FFFFFF | 5.57:1 | Pass | Pass | Fail | Pass |
| #767676 | #FFFFFF | 4.54:1 | Pass | Pass | Fail | Pass |
| #949494 | #FFFFFF | 3.03:1 | Fail | Pass | Fail | Fail |
| #FFFFFF | #FFFF00 | 1.07:1 | Fail | Fail | Fail | Fail |
#767676 and #595959 are the exact boundary greys for AA and AAA body text on white, which makes them useful reference points when picking a muted text colour. Large text means 18pt, or 14pt bold, and above.
WCAG contrast ratio thresholds
WCAG 2.1 requires a contrast ratio of at least 4.5:1 for normal text (AA) and 7:1 for enhanced compliance (AAA). Large text (18pt+ or 14pt+ bold) gets relaxed thresholds: 3:1 for AA, 4.5:1 for AAA. The ratio is calculated from the relative luminance of each color.
How relative luminance is calculated
Each sRGB channel is linearized (removing gamma), then weighted: L = 0.2126R + 0.7152G + 0.0722B. The contrast ratio is (L_lighter + 0.05) / (L_darker + 0.05). Black on white = 21:1 (maximum); same color on itself = 1:1 (minimum). Anything below 3:1 is generally unreadable for impaired vision.
Frequently asked questions
My brand uses light gray (#999) text on white — does it pass WCAG?
No. #999999 on #FFFFFF has a contrast ratio of about 2.85:1, which fails even the AA threshold of 4.5:1 for normal text. You'd need at least #767676 (4.54:1) to pass AA for normal-sized text.
What contrast ratio do I need for accessibility?
WCAG 2.1 requires 4.5:1 for normal text at AA level and 7:1 for AAA. Large text (18pt+ or 14pt+ bold) gets relaxed thresholds: 3:1 for AA and 4.5:1 for AAA.
Does this work with any color format, not just hex?
This calculator accepts hex color codes (#RRGGBB). If you have RGB values, convert them to hex first — each channel from 0-255 maps to a two-digit hex value (e.g., rgb(255, 128, 0) = #FF8000).
Related Developer calculators
SSL Certificate Expiry Calculator
Check days remaining until an SSL/TLS certificate expires.
OpenJWT Decoder
Decode a JWT token into header, payload, and expiration status.
OpenCron Schedule Explainer
Parse a cron expression into a human-readable schedule description.
OpenAI Feature Gross Margin Calculator
Gross margin of a per-user AI feature after tokens, retries, and cache.
OpenLast updated: September 7, 2026