contrast-checker
/// COLOUR
Contrast Checker
Enter a foreground and background colour and see the contrast ratio, with a pass or fail against WCAG 2.1 AA and AAA for both normal text, large text, and UI components.
Runs locally. No data sent anywhere.
Calculated WCAG 2.1 Contrast Ratio
Live Visual Preview
Large Heading Text (24px / 18pt)
This paragraph demonstrates body copy legibility. WCAG AA requires at least 4.5:1 for regular text below 18pt (or bold below 14pt). High contrast prevents fatigue and ensures accessibility in bright sunlight or low-contrast screens.
WCAG 2.1 Criteria Matrix
Body copy & small text (< 18pt or < 14pt bold)
Optimal legibility for small & fine print
Headings (≥ 18pt / 24px, or ≥ 14pt / 18.5px bold)
High-contrast headings & titles
Form boundaries, button outlines & essential icons
// Standards-Compliant Relative Luminance:
Luminance is calculated using the official W3C formula: sRGB channels are linearized via C ≤ 0.04045 ? C / 12.92 : ((C + 0.055) / 1.055)^2.4, weighted as 0.2126 R + 0.7152 G + 0.0722 B, and evaluated via (L1 + 0.05) / (L2 + 0.05).
// Runs entirely in your browser. Nothing is uploaded, nothing is stored, and it keeps working with the network off.