What it does
The Web Content Accessibility Guidelines (WCAG) define a contrast ratio from 1:1 (identical colors) to 21:1 (black on white). Enough contrast helps people with low vision and anyone reading in bright light.
The thresholds
- AA normal text: at least 4.5:1.
- AA large text (18 pt, or 14 pt bold, and above): at least 3:1.
- AAA: 7:1 for normal text and 4.5:1 for large text.
- UI components and graphics such as icons and input borders: at least 3:1.
The ratio is shown rounded down to two decimals, so a value like 4.499 never appears as a pass. If a color has transparency it is blended over the background before measuring.
Example
#767676 text on white measures 4.54:1, which passes AA for normal text, while the very similar #777777 measures 4.47:1 and fails it. Dark grey #1f2937 on white gives 14.67:1, which passes every level. Use Swap colors to test the reverse pairing for a dark theme, or the pickers to adjust a colour; the sample below the table shows the pair at normal and large size.
Limits
- The ratio uses the WCAG 2.x formula. It does not model newer perceptual methods, font weight or thin strokes, so a pass is a minimum rather than proof that text is comfortable to read.
- Large text means 18 pt (24 CSS px) or 14 pt bold (about 18.67 px) and up. To convert a size you have in other units, use the PX to REM Converter.
- A background with transparency is blended over white, and a semi-transparent text colour over the background, before measuring. A real page may have something else behind it.
- Gradients and images behind text cannot be measured here; test the lightest and darkest parts separately.
currentcolor,inheritand similar keywords are rejected because they depend on the page. Newer colour spaces such asoklch()are not read; convert them to HEX first, or check a colour in another notation with the Color Converter.
Examples on a white background
These are real results for grey text on a white background:
#767676on#ffffffhas a contrast ratio of 4.54:1. It passes AA for normal and large text and for UI components, but fails AAA for normal text. It is the lightest grey that passes AA on white.#777777on#ffffffhas 4.47:1. That is just under 4.5:1, so it fails AA for normal text, although a one-step difference looks identical to the eye.#999999on#ffffffhas 2.84:1 and fails every level, even for large text and UI components.
What the levels require
- AA, normal text: at least 4.5:1.
- AA, large text: at least 3:1. Large means 18 points (24 pixels) or more, or 14 points (about 18.7 pixels) or more in bold.
- AAA, normal text: at least 7:1, and AAA, large text: at least 4.5:1.
- UI components and graphics: at least 3:1, for example the border of an input field or an icon.
To convert a colour between formats first, use the Color Converter.
Frequently asked questions
Which formula is used?
The WCAG 2 contrast ratio, the relative luminance of the lighter colour plus 0.05 divided by that of the darker colour plus 0.05.
Does a pass guarantee good readability?
No. Font weight, size, spacing and the surrounding design matter too. The ratio is the measurable minimum that the guidelines ask for.
Do the rules apply to logos and disabled buttons?
Logos and inactive controls are exempt from the contrast requirements.
Are my colours sent to a server?
No. The calculation runs in your browser.
Privacy
This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.