Contrast Ratio Calculator
Calculate the WCAG contrast ratio between two HEX or RGB colors and check AA and AAA text thresholds instantly.
About the contrast ratio calculator
Color contrast examples
These common color pairs show how small visual changes can cross an accessibility threshold.
| Color pair | Contrast ratio | WCAG result |
|---|---|---|
| #FFFFFF and #000000 | 21.00:1 | Passes AA and AAA for normal and large text. |
| #FFFFFF and #777777 | 4.48:1 | Passes large-text AA but narrowly fails normal-text AA. |
| #FFFFFF and #005FCC | 5.98:1 | Passes normal-text AA and large-text AAA, but not normal-text AAA. |
How to check a color contrast ratio
- Copy the foreground and background colors from your design as HEX or RGB values.
- Enter the lighter color and darker color in the two fields.
- Select Calculate Contrast to compute the WCAG luminance ratio.
- Review each AA and AAA result for normal and large text.
- Adjust failing colors and retest every interactive state in the finished interface.
Contrast ratio calculator FAQ
What contrast ratio does normal text need?
WCAG 2.x level AA requires at least 4.5:1 for normal text. Level AAA requires at least 7:1, though project requirements should determine the target.
What counts as large text?
Large text is generally at least 18 point regular or 14 point bold. In typical CSS terms, those sizes are approximately 24 pixels and 18.66 pixels respectively.
Does it matter which color I enter first?
No, the formula always places the lighter luminance above the darker luminance. Reversing foreground and background therefore produces the same numeric contrast ratio.
Why does a visually different pair still fail?
Hue difference is not the same as luminance difference. Two saturated colors can look distinct while remaining too close in brightness for accessible text.
Does passing this check make a page accessible?
No, contrast is only one accessibility requirement. Keyboard use, semantics, focus, text alternatives, reflow, motion, and assistive-technology behavior must also be tested.