Contrast
Difference is what makes anything perceivable, and it is measurable for text against its background.
Definition
Contrast is the perceptible difference between two elements. It operates on lightness, colour, size, weight, shape and texture. For text and interface controls it is also a measurable accessibility requirement.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this page
WCAG contrast minimums
| Content | AA | AAA |
|---|---|---|
| Body text under 18.66px regular | 4.5:1 | 7:1 |
| Large text, 24px or 18.66px bold and above | 3:1 | 4.5:1 |
| Interface components and graphical objects | 3:1 | Not defined |
| Disabled controls and decorative text | Exempt | Exempt |
| Logotypes | Exempt | Exempt |
Contrast beyond text
- Input borders need 3:1 against their surroundings, or the field is invisible to some users.
- Focus indicators need 3:1 against the adjacent background, and WCAG 2.2 adds specific requirements for focus appearance.
- Icons that carry meaning need 3:1. Purely decorative icons do not.
- Chart series need to be distinguishable by more than hue, since adjacent hues at equal lightness are indistinguishable to many readers.
- Placeholder text is text. Grey placeholders below 4.5:1 fail, and placeholders should not carry essential information anyway.
In practice
Grey on grey
A common failureSecondary text at around 3:1 looks refined on a designer's calibrated display and disappears on a laptop screen in daylight. Test in bad conditions, not good ones.
Dark mode inversion
ThemingContrast ratios do not transfer when a palette is inverted. Pure white on pure black exceeds the ratio and produces halation for many readers. Off-white on a dark grey usually reads better and still passes.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
Understanding Success Criterion 1.4.3: Contrast (Minimum)
W3C, WCAG 2.1
Understanding Success Criterion 1.4.11: Non-text Contrast
W3C, WCAG 2.1
APCA, the Accessible Perceptual Contrast Algorithm
Myndex Research
Candidate method for WCAG 3. Not currently normative.
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Applies when you are designing
Relied on by
Entries that assume this is already in place.
- Visual HierarchyUI foundation
Hierarchy is built from contrast in size, weight, colour and space.
Commonly confused with
Close enough to be mixed up, different enough to matter.
- Use of ColorAccessibility
Contrast is a measurable ratio. Use of colour is whether meaning survives without it.
Check your work
Review passes that test whether this was done properly.
- Accessibility ChecklistChecklist
Related concept
Connected closely enough to change how you apply this.
- Focus IndicatorsAccessibility
- WCAG in PracticeAccessibility
- ThemingDesign system
- Borders and DividersUI foundation
- Brand Color in InterfacesUI foundation
- Color AccessibilityUI foundation
- Dark ModeUI foundation
- Data Visualization ColorUI foundation
- EmphasisUI foundation
- Figure and GroundUI foundation
- Font WeightUI foundation
- LightnessUI foundation
- NeutralsUI foundation
- ReadabilityUI foundation
- SaturationUI foundation
- Typographic HierarchyUI foundation