Accessibility

Colour contrast ratio

Colour contrast ratio is a numerical measure of the visual difference in luminance between text or graphical elements and their background color.

also called: color contrast ratio, contrast ratio, colour contrast

// definition

Colour contrast ratio represents the difference in visual luminance between two adjacent colors, typically foreground text and its surrounding background. The ratio is expressed as a numerical value ranging from 1:1, representing no contrast such as white text on a white background, to 21:1, representing maximum contrast such as black text on a white background.

Digital accessibility standards established by the Web Content Accessibility Guidelines (WCAG) specify minimum contrast thresholds to ensure content remains readable. For standard body text, Level AA compliance requires a minimum contrast ratio of 4.5:1, whereas large text requires a ratio of 3:1. Higher compliance levels, such as Level AAA, require a 7:1 ratio for normal text. These calculations evaluate relative luminance, which accounts for human visual perception of different wavelengths of light.

// why it matters

Insufficient colour contrast creates significant barriers for users with visual impairments, low vision, colour blindness, or age-related vision loss, as well as users in high-glare environments. For a business operating a digital platform, maintaining adequate contrast ratios ensures that critical information, navigational elements, and transactional workflows remain readable for all visitors. Meeting these standards supports compliance with legal mandates, such as the Americans with Disabilities Act (ADA), thereby reducing legal risk. Additionally, accessible design improves overall user comprehension, reduces bounce rates, and expands the total addressable audience for digital products.

// example

A financial application uses light grey text (#888888) on a white background (#FFFFFF) for account disclaimers, resulting in a contrast ratio of 3.5:1. This fails the Web Content Accessibility Guidelines requirement of 4.5:1 for normal text. To resolve the issue, the design team updates the text color to dark grey (#595959), raising the contrast ratio to 4.54:1. This change makes the text legible for users with reduced vision while maintaining compliance.

Questions and Answers

How is the colour contrast ratio calculated?
The colour contrast ratio is calculated using relative luminance, which measures the perceived brightness of a color based on human visual sensitivity. The mathematical formula compares the relative luminance of the lighter color to that of the darker color, producing a ratio between 1:1 and 21:1. Web development tools automatically perform this evaluation using hex codes.
Does colour contrast ratio apply to non-text elements?
Yes, under current Web Content Accessibility Guidelines standards, active user interface components and graphical objects must meet a minimum contrast ratio of 3:1 against adjacent colors. This requirement applies to interactive controls, such as button borders, form field outlines, focus indicators, and essential graphics like icons or charts needed to understand content.
What tools can test a website's colour contrast ratio?
Designers and developers can test colour contrast ratios using specialized browser extensions, automated accessibility evaluation tools, and integrated design software plugins. These applications analyze foreground and background color combinations against technical standards, highlighting elements that fail minimum threshold requirements and providing suggested color adjustments to achieve compliance.