Check the contrast ratio between a text color and a background color against WCAG 2.x AA and AAA, with a live preview and suggested colors that pass. Accepts HEX, rgb() and hsl() values with transparency, and simulates how the colors look with protanopia, deuteranopia and tritanopia.
The Contrast Checker calculates the contrast ratio between a foreground (text) color and a background color, as defined by the Web Content Accessibility Guidelines (WCAG) 2.x, and shows which success criteria the pair meets. If it fails, the tool suggests the nearest colors that pass.
#RGB, #RGBA, #RRGGBB, #RRGGBBAA), rgb() / rgba() and hsl() / hsla(), plus a color picker| Criterion | Level | Minimum ratio |
|---|---|---|
| 1.4.3 Contrast (Minimum), normal text | AA | 4.5:1 |
| 1.4.3 Contrast (Minimum), large text | AA | 3:1 |
| 1.4.6 Contrast (Enhanced), normal text | AAA | 7:1 |
| 1.4.6 Contrast (Enhanced), large text | AAA | 4.5:1 |
| 1.4.11 Non-text Contrast (UI components and graphics) | AA | 3:1 |
Large text is at least 18pt (24px), or at least 14pt (about 18.66px) and bold.
L = 0.2126 R + 0.7152 G + 0.0722 B, using linearized sRGB values.(L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color. It ranges from 1:1 to 21:1.#777777 on white is 4.48:1 and fails 4.5:1, while #767676 is 4.54:1 and passes.Suggestions only change the lightness of the color you adjust. If no lightness reaches the target ratio, for example with a very transparent foreground, no color is shown for that direction.
It uses the matrices by Machado, Oliveira and Fernandes (2009) at full severity, applied in linear RGB. It is an approximation, and how colors look varies from person to person. The WCAG results are always based on the original colors.
No. The tool uses the WCAG 2.x contrast ratio, the formula used by WCAG 2.1 and 2.2, which most accessibility requirements refer to today.
No. All calculations run in your browser.