Color Contrast Checker
Check the contrast ratio between two colors and see instant WCAG 2.1 AA and AAA pass or fail results for normal and large text. Enter any hex colors.
Color Contrast Checker
Method
How this calculator works
For each 8-bit channel: s = v/255; linear = s ≤ 0.03928 ? s/12.92 : ((s+0.055)/1.055)^2.4. Luminance L = 0.2126·R + 0.7152·G + 0.0722·B. Contrast ratio = (L_light + 0.05) ÷ (L_dark + 0.05).
- Pick or type a foreground (text) color as a hex value.
- Pick or type a background color as a hex value.
- The tool converts each color to its WCAG relative luminance.
- It divides the lighter luminance plus 0.05 by the darker luminance plus 0.05 and checks the result against every WCAG threshold.
Examples
Worked examples
Real numbers, end-to-end results.
#595959 text on #FFFFFF background
≈ 7.0:1 — passes AA and AAA normal text
A mid grey on white is a common accessible body-text combination.
#777777 text on #FFFFFF background
≈ 4.48:1 — fails AA normal, passes AA large
Just below the 4.5:1 threshold, so it should only be used for large headings.
Use cases
When to use it
- Verifying body text meets WCAG AA before shipping a design.
- Choosing accessible link and button colors for a brand palette.
- Auditing an existing site for low-contrast text.
- Deciding whether a color pair needs a darker or lighter adjustment.
FAQ
Frequently asked questions
What is a color contrast ratio?
What are the WCAG contrast requirements?
How is the contrast ratio calculated?
What is the difference between AA and AAA?
Does contrast apply to non-text elements too?
Related tools
All calculators →Color Code Converter
Convert colors between HEX, RGB, HSL, and HSV with live preview.
PPI Calculator (Pixels Per Inch)
Calculate a screen’s pixels per inch from resolution and diagonal size.
Image Aspect Ratio Calculator
Calculate image aspect ratios, resize dimensions, and find ratios for social media.