Color Contrast Checker
Check foreground/background color contrast against WCAG 2.1 standards.
How it works
- 1
Pick your colors
Select foreground and background colors using the color pickers or enter hex values.
- 2
Check the ratio
See the contrast ratio and WCAG AA/AAA pass/fail results for normal text, large text, and UI components.
- 3
Adjust until passing
Tweak your colors until all required WCAG levels show green checkmarks.
Common use cases
High contrast
Foreground #000000 on Background #FFFFFF
Low contrast
Foreground #777777 on Background #FFFFFF
About This Tool
Verify that your text and UI colors meet WCAG 2.1 accessibility requirements with this free contrast checker. Pick foreground and background colors using the color picker or enter hex values, and instantly see the contrast ratio alongside pass/fail results for AA and AAA compliance at normal text, large text, and UI component levels.
Live preview: See your color combination rendered at different text sizes so you can judge readability before committing to a palette.
All calculations run entirely in your browser using the standard sRGB luminance formula — no data is ever sent to a server.
Color contrast accessibility is one of the most impactful aspects of inclusive web design. Approximately 8% of men and 0.5% of women have some form of color vision deficiency, and many more users experience temporary or situational vision impairment from bright sunlight, screen glare, or aging eyes. Ensuring sufficient contrast between text and background colors makes your content readable for everyone.
The WCAG 2.1 standard defines specific contrast ratio requirements at three compliance levels. The AA level is the minimum standard for most websites and legal accessibility requirements. The AAA level provides enhanced readability and is recommended for content that requires maximum legibility, such as medical information, legal documents, and educational materials.
Normal text (below 18 px or below 14 px bold) requires a 4.5:1 contrast ratio for AA compliance and 7:1 for AAA. Large text (18 px or larger bold, or 24 px or larger at any weight) requires 3:1 for AA and 4.5:1 for AAA. UI components and graphical objects (like icons and form borders) require at least 3:1 contrast against adjacent colors. These requirements exist because larger text is easier to read at lower contrast, and UI elements have contextual cues beyond color alone.
The contrast ratio is calculated using the relative luminance of the two colors in the sRGB color space. Luminance is computed by converting each RGB channel to a linear value, applying the standard formula, and comparing the lighter and darker values: (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 is the darker. This produces a ratio from 1:1 (no contrast, identical colors) to 21:1 (maximum contrast, black on white).
Common contrast failures to watch for: Light gray text on white backgrounds (a frequent design trend that fails accessibility), low-opacity text overlays on images where the image content creates unpredictable contrast, colored text on colored backgrounds within brand color schemes, and placeholder text in form fields that is too faint to read.
Testing workflow: Start by checking your primary text color against your main background color. Then test secondary text, link colors, and muted text variants. Check form labels, placeholder text, error messages, and button text. For dark mode themes, re-test all color pairs since the contrast landscape changes entirely. Test hover and focus states as well, since color changes during interaction must also maintain sufficient contrast.
The live preview feature lets you see exactly how your color combination looks at different text sizes. This is particularly useful because the same contrast ratio can feel different depending on font size, weight, and rendering. A 4.5:1 ratio that looks acceptable on large text might feel difficult to read on small body text.
More examples
Examples
High contrast
Input
Foreground #000000 on Background #FFFFFF
Output
21:1 — Passes AA and AAA for all text sizes
Low contrast
Input
Foreground #777777 on Background #FFFFFF
Output
4.48:1 — Fails AA normal text, passes AA large text
Frequently Asked Questions
- What is WCAG 2.1?
- WCAG (Web Content Accessibility Guidelines) 2.1 is an international standard for making web content accessible. It defines minimum contrast ratios between text and background colors to ensure readability for people with low vision or color blindness. WCAG 2.1 extends 2.0 with additional criteria for mobile and low-vision users.
- What contrast ratio do I need?
- WCAG AA requires 4.5:1 for normal text and 3:1 for large text (18px+ bold or 24px+ regular). WCAG AAA requires 7:1 for normal text and 4.5:1 for large text. UI components need at least 3:1. These are minimums — higher contrast is always better for readability.
- What counts as large text?
- Large text is defined as 18.66px (14pt) and bold, or 24px (18pt) and above at any weight. Large text has a lower contrast requirement because larger characters are easier to read even at reduced contrast.
- Is my data sent to a server?
- No. All calculations run in your browser using JavaScript. No color data is transmitted to any server. The tool works offline once loaded.
- What is the maximum possible contrast ratio?
- The maximum contrast ratio is 21:1, achieved by pure black (#000000) on pure white (#FFFFFF). Most color pairs fall between 1:1 and 21:1. A ratio of 1:1 means the two colors are identical.
- Does font weight affect contrast requirements?
- Font weight affects the text size threshold for "large text" classification but not the contrast ratio calculation itself. Bold text at 14pt (18.66px) or larger qualifies as large text with the lower 3:1 AA requirement. Thinner fonts at the same pixel size may need the higher 4.5:1 ratio.
- What are common contrast mistakes?
- The most common mistakes are: light gray text on white backgrounds, low-opacity text overlays on images, colored text on similarly colored backgrounds, and insufficient contrast in dark mode themes. Always re-test all color pairs when switching between light and dark modes.
- Do I need to check contrast for decorative text?
- WCAG contrast requirements apply to text that communicates information. Purely decorative text (like a background watermark) is exempt. However, placeholder text in form fields, disabled button text, and helper text all need to meet minimum contrast requirements.
Learn More
Related Guides
Discover More Tools
View all Design Tools →Color Converter
Convert colors between HEX, RGB, HSL, and OKLCH formats.
Color Palette Generator
Generate harmonious color palettes from any base color with WCAG contrast checking.
Color Picker from Image
Upload an image, sample any pixel, and copy the color as HEX, RGB, or HSL.
CSS Unit Converter
Convert between px, rem, em, vw, vh, %, and pt.