How Contrast Checker works
Pick two colors to see their WCAG 2.1 contrast ratio along with pass and fail results for AA and AAA at normal and large sizes. If the pair fails, get a suggested foreground that passes.
Calculates the contrast ratio using the WCAG 2.1 relative luminance algorithm and walks the HSL lightness axis to find the nearest compliant foreground.
Questions
- What is a passing contrast ratio?
- WCAG AA requires 4.5:1 for normal text and 3:1 for large text. AAA is stricter: 7:1 for normal and 4.5:1 for large.
- How is "large text" defined?
- WCAG defines large text as 18pt (24px) regular or 14pt (18.66px) bold or larger.
- How does the suggestion feature work?
- The tool keeps the background unchanged and walks the foreground's lightness axis in HSL until the contrast ratio meets AA normal.
- Can I enter rgb() or hsl() values?
- Yes. The text input accepts hex, rgb(), hsl(), and common CSS named colors.
More Generate tools
- QR CodeURL, text, or contact card
- ShareX Config BuilderGenerate a .sxcu custom uploader
- Color PaletteHEX / RGB / HSL converter
- Regex TesterLive match highlighting
- Cron BuilderHuman-readable schedules
- Lorem IpsumParagraphs, sentences, words
- Aspect RatioCalculate and convert aspect ratios
- Markdown TableVisual editor for markdown tables
- Placeholder ImageCustom placeholder images for mockups
- Meta Tag PreviewerSee how links unfurl across platforms
- Favicon GeneratorEmoji, text, or image favicons
- Secret GeneratorRandom keys and passwords
- Theme TokensThis site's color roles, live
- UUID GeneratorBulk v4 and v7 UUIDs
- Date CalculatorDays between dates, date math, time zones
- Chmod CalculatorUnix permissions: octal, symbolic, command