Color Contrast Checker
Check the WCAG 2.1 contrast ratio between a text and background color in hex, rgb() or hsl(), with AA and AAA results for normal and large text.
Color Contrast Checker
Foreground color
Background color
Aa
Sample text
Smaller text preview
Contrast ratio 21.00 to 1. Normal text passes AA, large text passes AA.
Contrast ratio
Normal text
Large text (18pt+)
AA (4.5:1): Minimum contrast for normal text. AAA (7:1): Enhanced contrast. Large text has lower requirements.
Updated . Provided as is. Check the output before you rely on it in production.
How to use Color Contrast Checker
- 1
Enter foreground and background colors
Use the color pickers or paste color values in hex (#RRGGBB), RGB (rgb(r,g,b)), or HSL (hsl(h,s%,l%)) format. The live preview updates instantly.
- 2
Check WCAG compliance levels
Review the contrast ratio and AA/AAA badges for both normal and large text. Green checkmarks mean pass, red X means fail. Use this to validate your color scheme meets accessibility standards.
- 3
Compare text readability
See how your chosen colors look with real sample text in the preview. Adjust colors until you achieve the contrast level you need—AA (4.5:1) for legal compliance, AAA (7:1) for maximum accessibility.
- 4
Swap colors to test both directions
Use the Swap control to test if the inverse color combination (light text on dark background vs dark on light) also meets your contrast needs. Useful for multi-variant designs.
- 5
Copy ratio and integrate
Once you find compliant colors, copy the ratio to clipboard and apply the color codes in your CSS, design tool, or style guide documentation.
Questions and answers
What is WCAG 2.1 contrast ratio?
Why is AA compliance important?
What color formats does the checker support?
Can I check contrast for different text sizes?
Is this tool free and does it store my data?
Use it as an API
Color Contrast Checker is also callable as a free HTTP JSON API at
https://aidevhub.io/api/color-contrast-checker/ — GET with query
parameters or POST with a JSON body, no authentication, CORS enabled, fair use
(abusive traffic is throttled at the edge; there is no per-request quota header). Responses return
{ ok, tool, result, meta }.
curl -s "https://aidevhub.io/api/color-contrast-checker/?foreground=%23ffffff&background=%230a0a0a"
Machine-readable contract: /api/tool/color-contrast-checker.json All API endpoints: /agents/ LLM site index: /llms.txt
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Dedicated API endpoint
Deterministic outputs, machine-safe contracts, and production-ready examples.
Dedicated API
https://aidevhub.io/api/color-contrast-checker/ OpenAPI: https://aidevhub.io/api/openapi.yaml