Contrast Checker
Check the contrast ratio between text and background colors against WCAG 2.2 AA and AAA, with live preview and suggested fixes.
HEX, rgb(), hsl(), oklch() or a color name
HEX, rgb(), hsl(), oklch() or a color name
Good — passes AA for all text sizes
Exact 4.8345:1
- PassAA · Normal textSC 1.4.3 · below 24px, or below 18.66px bold · needs 4.5:1
- PassAA · Large textSC 1.4.3 · 24px+, or 18.66px+ bold · needs 3:1
- FailAAA · Normal textSC 1.4.6 · enhanced contrast · needs 7:1
- PassAAA · Large textSC 1.4.6 · enhanced, large text · needs 4.5:1
- PassUI components & graphicsSC 1.4.11 · borders, icons, focus rings · needs 3:1
Live preview
Large text · 24px regular
Large bold text · 18.66px (14pt) bold
Normal body text at 16px. The quick brown fox jumps over the lazy dog — readable text needs at least 4.5:1 to pass AA.
Small print at 13px, like captions, footnotes and form hints.
Suggested fixes
The closest colors that pass, found by changing only lightness in OKLCH so the hue stays the same.
AA · 4.5:1
Already passes.
AAA · 7:1
No background with this hue reaches this ratio with the current text color.
OK for content text that isn't body copy
Informative only: APCA is a candidate method for a future WCAG 3 and is not used for WCAG 2.2 conformance.
Copy a link that opens this checker with the current colors, or copy them as CSS.
What is the Color Contrast Checker?
This contrast checker calculates the contrast ratio between a text color and a background color exactly as defined in WCAG 2.2. Each color is converted to its relative luminance — the sRGB channels are linearized and weighted 21.26% red, 71.52% green and 7.22% blue — and the ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color. The result ranges from 1:1 (identical colors) to 21:1 (black on white). Values are never rounded up: 4.499:1 is shown as 4.49:1 and fails, because WCAG treats the thresholds as hard minimums.
The pass/fail badges cover every contrast criterion in WCAG 2.2. Success Criterion 1.4.3 (Level AA) requires 4.5:1 for normal text and 3:1 for large text, which WCAG defines as at least 18pt (24px) regular or 14pt (about 18.66px) bold. SC 1.4.6 (Level AAA) raises this to 7:1 and 4.5:1. SC 1.4.11 asks for 3:1 for the visual parts of user interface components and meaningful graphics, such as input borders, focus indicators and icons.
Colors can be entered as HEX (3, 4, 6 or 8 digits), rgb(), rgba(), hsl(), hwb(), oklch() or any CSS color name. Semi-transparent text is blended with the background first, so the ratio reflects what users actually see. When a pair fails, Suggested fixes searches OKLCH lightness for the nearest text or background color that reaches AA or AAA without changing the hue, so a brand blue stays blue. The APCA Lc value is shown for reference only. Everything runs in your browser.
Frequently asked questions
- What contrast ratio do I need to pass WCAG AA?
- At least 4.5:1 for normal body text and 3:1 for large text (24px regular or 18.66px bold and up). User interface components and meaningful graphics also need 3:1 against adjacent colors under SC 1.4.11. For Level AAA, text needs 7:1, or 4.5:1 if it is large.
- Why does #777777 on white fail when it looks fine?
- #777777 on #FFFFFF has a ratio of 4.48:1, just under the 4.5:1 minimum, and WCAG does not allow rounding up. #767676 is the lightest neutral gray that passes AA on white, at 4.54:1.
- What counts as large text in WCAG?
- Text that is at least 18 points (24 CSS pixels) at regular weight, or at least 14 points (about 18.66 CSS pixels) when bold. Most body text, including the browser default of 16px, counts as normal text and needs 4.5:1.
- How are transparent colors handled?
- A semi-transparent text color is blended with the background, the same way the browser blends it, before the ratio is calculated. A transparent background is assumed to sit on a white page. Suggested text colors are opaque.
- Do logos, disabled buttons and placeholder text need to pass?
- Logos and brand names, purely decorative text and inactive (disabled) controls are exempt from SC 1.4.3. Placeholder text is not exempt: if it conveys information, it needs 4.5:1 like any other text.
- What is APCA and should I use it instead of WCAG 2?
- APCA (Accessible Perceptual Contrast Algorithm) is a candidate contrast method being explored for a future WCAG 3. It models perceived contrast better, especially for dark themes, but it is still a draft. Legal and procurement requirements such as the ADA, Section 508 and EN 301 549 reference WCAG 2.x, so use the ratio for compliance and APCA as extra guidance.
Related tools
- Image to WebPConvert PNG and JPEG images to lightweight WebP with adjustable quality, batch processing and ZIP download — no uploads.
- Image ResizerResize and compress JPG, PNG and WebP images by pixels or percentage, keep the aspect ratio and download in bulk. Nothing is uploaded.
- SVG OptimizerMinify and clean SVG files with SVGO directly in your browser. Compare sizes, preview the result and download the optimized SVG.
- Favicon GeneratorGenerate a complete favicon set (multi-size ICO, PNGs, Apple touch icon and web manifest) from an image, a letter or an emoji — entirely in your browser.
- Color ConverterConvert colors between HEX, RGB, HSL, HSV, CMYK and OKLCH, pick colors visually and generate shades, tints and color harmonies.
- CSS Gradient GeneratorDesign linear, radial and conic CSS gradients with multiple color stops and copy production-ready CSS or Tailwind code.