Check WCAG AA and AAA contrast ratios for accessibility - a client-side contrast checker that runs in your browser.
Loading...
Loading...
A contrast checker is a tool that measures the visual contrast ratio between two colors β typically foreground text and a background color β and evaluates whether that combination meets the Web Content Accessibility Guidelines (WCAG) published by the W3C. The contrast ratio is a numerical value ranging from 1:1 (no contrast, identical colors) to 21:1 (maximum contrast, pure white on pure black). Higher ratios mean text is easier to read, which is critical for users with low vision, color blindness, or situational impairments like bright sunlight.
DevToolsHubβs Contrast Checker calculates the exact contrast ratio in real time as you adjust colors, and immediately shows you which WCAG compliance levels you pass or fail. It also suggests accessible alternatives when your current combination doesnβt meet the required threshold. Everything runs 100% client-side β your colors are never sent to a server.
#1a73e8) in the foreground input.WCAG 2.0 and 2.1 define two levels of conformance for text contrast:
The contrast ratio formula, defined by WCAG, uses the relative luminance of each color. Relative luminance is calculated by linearizing the sRGB channel values and applying weighted coefficients (0.2126 for red, 0.7152 for green, 0.0722 for blue). The ratio is then (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter luminance and L2 is the darker. This formula ensures that the ratio is always between 1 and 21.
Note that contrast ratio is symmetric β swapping foreground and background does not change the ratio. However, the visual perception of readability can differ: dark text on a light background is generally easier to read than light text on a dark background at the same numerical ratio.
Loading...