Image Contrast Checker
Check whether text over a photo, banner or screenshot is readable. Drag a box around the text: the checker finds the text and background colors, measures the WCAG contrast against every background pixel, marks where it fails and tells you how dark an overlay you need.
Click to upload or drag and drop
PNG, JPG, WebP or GIF (max. 10MB)
…or paste a screenshot with Ctrl+V (⌘+V on a Mac). To check a web page, take a screenshot of it and paste it here.
How it works
Contrast under WCAG depends only on luminance, so the pixels inside your rectangle are split by luminance into two groups with Otsu’s method. Letters are thin strokes and backgrounds are solid areas, so the group made of thinner shapes is taken as the text. A patch of the background as light as the letters, such as the sun or a reflection, is much thicker than a stroke and is put back into the background, so the hardest part of the background is not lost. Background pixels touching the letters are left out, because anti-aliasing blends them with the text. The text color is the average of the half of the text pixels farthest from the split, so soft edges do not pull it toward the background.
The ratio is then computed with the WCAG 2 formula between the text color and each background pixel. The verdicts use the 10th percentile: nine background pixels in ten are at least that good. The red overlay shows the background pixels below the target you chose, 4.5:1 for normal text or 3:1 for large text.
When the result can mislead
If the guess is wrong, for example very bold text in a tight box, press “Swap” or set the text color by hand. Very thin or tiny text gives few text pixels, so draw the box tightly around it. Text with its own shadow or outline is measured against the background, not the shadow, so the real contrast may be better than shown.
Your image stays on your device
The image is processed in your browser. Nothing is uploaded or stored.
Image contrast checker: questions
- How do I check the contrast of text on an image?
- Upload the image or paste a screenshot, then drag a rectangle around the text. The checker separates the letters from the background, measures the WCAG contrast ratio of the text color against every background pixel in the rectangle, and shows the result for the worst 10% of the background and for the median.
- What contrast ratio does text over an image need?
- The same as any text under WCAG 2: at least 4.5:1 for normal text and 3:1 for large text (24px, or 18.66px bold) at level AA; 7:1 and 4.5:1 at level AAA. Over a photo the background changes from pixel to pixel, so the text has to reach the ratio against the lighter (or darker) parts too, not only on average.
- Why does the checker show two ratios?
- One ratio needs one background color, and a photo has hundreds. The median tells you how the text does on a typical part of the background; the worst 10% tells you how it does on the hardest part. The pass and fail verdicts use the worst 10%, which is our own conservative reading: WCAG does not say how to measure a varied background.
- How do I fix text that fails over an image?
- Put a semi-transparent dark layer between the image and light text (or a light layer under dark text). The checker calculates the smallest opacity that makes the worst 10% of the background pass, and gives it as an rgba() value. A solid box behind the text, a stronger text shadow or a different text color also work.
- Can I check the contrast of a whole website?
- Take a screenshot of the page and paste it here with Ctrl+V or ⌘+V, then select the text you are unsure about, such as a hero headline over a photo. For text on solid colors, the contrast checker with two HEX values is faster.
- Is my image uploaded?
- No. The image is read and measured in your browser. Nothing is sent to a server or stored.
Sources
- W3C (2018, current edition 6 May 2025). Web Content Accessibility Guidelines (WCAG) 2.1: definitions of relative luminance and contrast ratio, success criteria 1.4.3 and 1.4.6. Link