WCAG contrast checker
Related tools
Validators and utilities that complement WCAG contrast checker — same session, no sign-up.
Compute WCAG 2.x contrast ratio from two #RGB or #RRGGBB colors using sRGB relative luminance. Heuristic AA/AAA hints in UI.
#RGB or #RRGGBB only — WCAG 2.x contrast ratio for sRGB hex pairs.
How to use this tool
- Paste your sample in the input (or fetch from URL if this tool supports it).
- Run the main action on the page to execute WCAG contrast checker.
- Read the result, fix the source data or config, and re-run if needed.
What this check helps you catch
- Compute WCAG 2.x contrast ratio from two #RGB or #RRGGBB colors using sRGB relative luminance. Heuristic AA/AAA hints in UI.
- Limits called out in the description (what this tool does not verify — e.g. live network reachability, issuer databases, or strict schema contracts unless stated).
- Structural or syntax mistakes that would break parsers, serializers, or the next step in your workflow.
FAQ
- What does WCAG contrast checker do?
- Compute WCAG 2.x contrast ratio from two #RGB or #RRGGBB colors using sRGB relative luminance. Heuristic AA/AAA hints in UI. Use the form above, then see “How to use” and “What this check helps you catch” for behavior detail.
- Is this a substitute for server-side validation?
- No. Use it for manual checks and triage; production systems should still validate and authorize on the server.
- Where does processing happen?
- Most validators here run in your browser. If a tool calls an API, that is stated on the page. See the site privacy policy for data handling.
The WCAG Contrast Checker helps you evaluate the contrast ratio between two hex colors using sRGB luminance, so you can quickly assess whether text, icons, and interface elements are likely to meet accessibility expectations. Designers, developers, QA teams, and content editors use contrast checks to reduce readability issues and improve usability for people with low vision or color-vision differences. This tool is especially useful during UI design, design system reviews, and front-end implementation when color choices need to be validated against WCAG contrast guidance.
How This Validator Works
This checker compares two hexadecimal color values by converting them into relative luminance values in the sRGB color space. It then calculates the contrast ratio between the foreground and background colors. The result is a numeric ratio that can be compared against WCAG contrast thresholds for normal text, large text, and non-text UI components.
- Accepts two hex color values, such as foreground and background colors
- Converts each color from hex to sRGB
- Calculates relative luminance for each color
- Computes the contrast ratio between the two values
- Helps you judge readability and accessibility risk
Common Validation Errors
- Invalid hex format, such as missing characters or unsupported symbols
- Using shorthand and full hex values inconsistently without proper parsing
- Choosing colors with insufficient contrast for body text
- Assuming contrast is acceptable without checking actual ratio values
- Testing only in one theme, such as light mode, and missing dark mode issues
- Relying on color alone to communicate meaning in the interface
Where This Validator Is Commonly Used
- Design systems and component libraries
- Accessibility reviews for websites and web apps
- UI and product design workflows
- Front-end development and implementation QA
- Content management and editorial publishing checks
- Dark mode and theme testing
- Brand color selection and visual identity review
Why Validation Matters
Color contrast affects how easily users can read text and distinguish interface elements. Validating contrast early helps teams catch accessibility problems before release, reducing rework and improving the experience for users with visual impairments or low-quality display conditions. It also supports more consistent design decisions across products, themes, and components.
Contrast validation is not only about compliance; it is also about clarity, usability, and inclusive design. A color pair that looks attractive in a mockup may still be difficult to read in real-world conditions, especially on mobile screens, in bright light, or for users with reduced vision.
Technical Details
- Input type: two hex color values
- Color model: sRGB
- Calculation basis: relative luminance
- Output: contrast ratio between foreground and background colors
- Primary use case: accessibility and readability assessment
| Check Type | What It Measures | Typical Use |
|---|---|---|
| Text contrast | Readability of foreground text against background | Body copy, labels, buttons |
| UI contrast | Visibility of interface elements | Icons, borders, controls |
| Theme contrast | Color pairing across light and dark modes | Design systems, app themes |
FAQ
What does the WCAG Contrast Checker measure?
It measures the contrast ratio between two hex colors using sRGB luminance. This helps determine whether a foreground and background color pair is likely to provide enough visual distinction for readable text or visible interface elements. The result is a ratio that can be compared with WCAG contrast guidance.
Does this tool guarantee WCAG compliance?
No. A contrast ratio is an important part of accessibility review, but it does not guarantee full WCAG compliance. Other factors matter too, including font size, font weight, text placement, and whether color is the only way information is conveyed. Use the result as one input in a broader accessibility check.
Can I use this for icons and UI components?
Yes. Contrast is relevant not only for text but also for icons, borders, controls, and other non-text elements. While the exact accessibility requirements may differ depending on the element and context, checking color contrast is still a useful step for improving visibility and usability.
Why do hex colors need to be converted to sRGB luminance?
Hex values are just a color encoding format. To compare contrast accurately, the colors must be converted into a luminance-based model. sRGB luminance provides a standardized way to estimate how bright a color appears relative to another color, which is the basis for contrast ratio calculations.
What is a good contrast ratio for text?
That depends on the text size and the accessibility target you are using. In general, higher contrast improves readability. Many teams use WCAG thresholds as a baseline for normal text, large text, and UI components, then review the result in the context of the actual design and user environment.
Why can a color pair look fine but still fail contrast checks?
Human perception is influenced by surrounding colors, display brightness, and personal vision differences. A pair may appear acceptable in a design mockup but still produce a low contrast ratio when measured objectively. That is why automated contrast checking is useful during design and development.
Should I test both light mode and dark mode?
Yes. A color pair that works well in one theme may fail in another. Testing both light and dark modes helps catch readability problems across different interface states, especially in products that support theme switching or system-based appearance settings.
Is contrast the same as accessibility?
No. Contrast is one part of accessibility, but not the whole picture. Accessible design also includes keyboard navigation, semantic HTML, focus states, labels, alternative text, and clear interaction patterns. Contrast checking is a practical and important step, but it should be used alongside other accessibility reviews.
Related Validators & Checkers
- Color Validator — checks color values and formatting
- CSS Validator — helps verify stylesheet syntax and structure
- HTML Validator — checks markup quality and document structure
- Accessibility Checker — broader review of usability and WCAG-related issues