How to use Contrast Checker
- Enter the text color and the background color, with the pickers or as HEX, rgb() or hsl() values.
- Read the contrast ratio and look at the preview with normal and large sample text.
- Check the table: each row shows the required ratio and whether your colors pass, or use Swap colors to test the reverse.
Features
- Contrast ratio from 1:1 to 21:1, using the WCAG 2.2 formula
- AA and AAA results for normal text and for large text
- Result for user interface components and graphics (3:1)
- Live preview with normal and large sample text
- Swap button, and semi-transparent text colors are blended over the background
Examples
| Input | Result |
|---|---|
| Text #000000 on background #FFFFFF | 21 : 1. Passes AA and AAA for normal and large text. |
| Text #4F33E8 on background #FFFFFF | 7.06 : 1. Passes AA and AAA for normal and large text. |
| Text #777777 on background #FFFFFF | 4.47 : 1. Fails AA for normal text (needs 4.5 : 1); passes AA for large text. |
Limitations
- The checker measures the two colors you enter; it cannot judge text over images or gradients, font weight and thickness, or how the text looks to people with low vision. Logos and purely decorative text are exempt from WCAG contrast rules. Ratios are truncated to two decimals, not rounded up, because WCAG requires the full threshold to be met.
Learn more
Text that is hard to read on its background excludes people with low vision, color-vision deficiencies or simply a bright screen in sunlight. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios so that most people can read text comfortably, and many laws and procurement rules refer to them.
The ratio compares the relative luminance of two colors, a number between 0 for black and 1 for white computed from the linear red, green and blue values. The ratio runs from 1:1, identical colors, to 21:1, black on white. Level AA asks for 4.5:1 for normal text and 3:1 for large text; level AAA asks for 7:1 and 4.5:1. Passing is necessary but not the whole story: font size, weight, spacing and the surrounding design all affect readability. Use this tool to test the pairs in your design system early, before the colors are everywhere.
Frequently asked questions
What contrast ratio does WCAG require?
For level AA, normal text needs at least 4.5:1 and large text at least 3:1. For level AAA, normal text needs 7:1 and large text 4.5:1. User interface components and graphics need 3:1.
What counts as large text?
At least 18 point (24 px) in regular weight, or at least 14 point (about 18.66 px) in bold.
Why does 4.499:1 fail even though it looks like 4.5:1?
WCAG says the ratio must not be rounded up. A result just below the threshold does not pass, so the tool truncates the displayed figure to two decimals.
How is the contrast ratio calculated?
Each color gets a relative luminance from its linearized red, green and blue values. The ratio is (lighter luminance + 0.05) divided by (darker luminance + 0.05).
Sources
- Web Content Accessibility Guidelines (WCAG) 2.2, W3C
- Understanding SC 1.4.3: Contrast (Minimum), W3C
- Understanding SC 1.4.6: Contrast (Enhanced), W3C
- Understanding SC 1.4.11: Non-text Contrast, W3C
Last reviewed: September 30, 2026