Colour Contrast Calculator
Check if text is easy to read against its background. Pick two colors, see them together and check their contrast against WCAG AA and AAA.
Pick a text color and a background color. The preview and contrast score update as you type. If a color is transparent, set the canvas color underneath it, too.
12.02:1 contrast ratio
Displayed ratio is rounded. Pass/fail uses the full value. Effective text ≈ #173d30; effective background ≈ #ffffff.
Large text at this size and weight. Large text starts at 24 CSS px regular or 18⅔ CSS px bold. Vision previews are approximate aids; WCAG results below use the original colors.
- AA normal text (4.5:1): Pass
- AA large text (3:1): Pass
- AAA normal text (7:1): Pass
- AAA large text (4.5:1): Pass
- Non-text contrast threshold (3:1): Pass
This tests color contrast, not full WCAG compliance. Non-text requirements depend on the component and surrounding colors.
Closest passing opaque foreground among 256 tested blends toward black and white, by RGB distance. This is a bounded search, not a globally nearest perceptual color.
Suggested foreground: #173d30 (12.0233:1)
Palette and CSS variables
Enter 2–20 colors, one per line, optionally as Name = color. Audit every ordered foreground/background pair over the current canvas.
Import literal color values only. Variable references, named colors, expressions and cascading rules are not resolved.
Sample an image background
Choose a local PNG, JPEG or WebP, up to 8 MiB and four million pixels. Click a pixel or use its original image coordinates. Sampling one pixel does not establish contrast across an entire image.
Batch CSV contrast reports
Use foreground and background headers, with optional name and canvas. Quote colors containing commas. Up to 100 rows and 1 MiB; every row must be valid.
Saved before and after pairs
Capture a before pair, change the colors, then save the comparison. Up to 20 comparisons stay in this tab until reload; download JSON to retain them.
How to use Colour Contrast Calculator
Enter hex, RGB or HSL foreground/background colors and an opaque canvas. Results update immediately; pass/fail uses unrounded ratios. Choose a 3:1, 4.5:1 or 7:1 suggestion target and apply the closest tested opaque foreground blend. Preview text size, weight and approximate color-vision variations. Import literal CSS variables into a palette and audit every ordered pair. Upload an image locally and sample a pixel by clicking or entering coordinates, then use that pixel as the background. Check CSV pairs and download their complete report. Capture a before pair, edit colors and save a comparison; download or restore saved-pair JSON. Clear resets the current pair and Undo restores it; separately managed imports and saved comparisons remain available.
Example
Black on white produces 21:1. Identical colors produce 1:1. #777777 on white is about 4.48:1, so it fails AA normal text despite looking close to 4.5:1.
About Colour Contrast Calculator
Contrast measures relative luminance. AA normal text needs 4.5:1 and large text 3:1; AAA needs 7:1 and 4.5:1 respectively. Large text starts at 24 CSS pixels regular or 18⅔ pixels bold. Transparent text is composited over the background, then the opaque canvas. One sampled image pixel does not represent the whole image. Machado-model vision previews are approximate and do not change the WCAG calculation. Suggestions search 256 blends toward black and white and are not a global perceptual optimum. This tests contrast only, not whole-page accessibility.
W3C guidance on minimum contrast
Processing stays in this tab. Reloading clears the workspace.
Stars and feedback
Loading…
What could we improve in Colour contrast calculator?
Email us feedback@tooltulip.com
Tool reference #058