Color Converter & Contrast Checker
Guide: How to Pick a Color Palette From a Photo
Nothing you enter or choose here leaves your device. This tool runs in your browser.
One color, three notations
The indigo used on this site can be written in several ways, and they all describe the same color:
| Format | Value | How to read it |
|---|---|---|
| HEX | #6366f1 | Red 63, green 66, blue F1, each in base 16 |
| RGB | rgb(99, 102, 241) | The same three numbers, from 0 to 255 |
| HSL | hsl(239, 84%, 67%) | Hue 239 degrees, 84 percent saturation, 67 percent lightness |
Type any of them, including three-digit HEX like #fff and versions with transparency, and copy the others. HSL is the friendliest to edit by hand: change the lightness to get a lighter or darker shade without touching the hue.
Checking contrast
Enter a background in the contrast checker and the tool gives the ratio between the two colors and pass or fail badges for the WCAG accessibility levels. The ratio runs from 1:1, where nothing can be read, up to 21:1 for black on white.
| Text color on white | Ratio | Normal text AA (4.5) | Large text AA (3) |
|---|---|---|---|
#000000 | 21.0:1 | Pass | Pass |
#1e3a8a | 10.4:1 | Pass | Pass |
#4f46e5 | 6.3:1 | Pass | Pass |
#767676 | 4.54:1 | Pass, just | Pass |
#777777 | 4.48:1 | Fail, just | Pass |
#6366f1 | 4.47:1 | Fail | Pass |
#ef4444 | 3.76:1 | Fail | Pass |
#16a34a | 3.3:1 | Fail | Pass |
Look at the middle rows. A single step in the gray, from #767676 to #777777, is the difference between passing and failing. And a bright, pleasant indigo or green that looks fine on a designer's screen can fail for body text.
What the levels mean
- AA is the usual target: 4.5 to 1 for normal text, 3 to 1 for large text and user interface parts like button borders.
- AAA is stricter: 7 to 1 for normal text and 4.5 to 1 for large.
- Large text means at least 24 pixels, or 18.66 pixels if bold. Anything smaller counts as normal.
Fixing a failing pair
- Darken the text, or lighten the background, until the ratio passes.
- Do it in HSL by lowering the lightness a few points at a time, keeping the hue the same.
- Keep a darker shade of the brand color just for text, and the main shade for large shapes and buttons.
- Don't rely on color alone to carry meaning. Red and green errors are indistinguishable to some people, so add an icon or a word.
Transparency is ignored in the check, because a see-through color depends on what's behind it. Test the final blended color. To pull a palette out of a picture, use the palette from image tool, and use the CSS generator for gradients and shadows.
Written by Akinrinmade Michael · Updated October 24, 2026
How to use
- 1Pick a color or type one as HEX, RGB or HSL.
- 2Copy the format you need from the list.
- 3In the contrast checker, enter a background color.
- 4Read the ratio and the WCAG pass or fail badges.
Frequently asked questions
What formats can I type in?
HEX (#6366f1, #fff, or with alpha like #6366f180), rgb(99, 102, 241) and hsl(239, 84%, 67%), including the rgba and hsla forms.
What is a good contrast ratio?
WCAG level AA needs at least 4.5:1 for normal text and 3:1 for large text. Level AAA needs 7:1 and 4.5:1. Higher is easier to read.
What counts as large text?
Text of at least 24 px, or 18.66 px if bold. Anything smaller counts as normal text.
Does transparency affect the contrast result?
The checker compares the solid colors and ignores transparency. Transparent colors change depending on what is behind them.
Read the guides
Learn how this works and how to get the most from it.
Images
How to Pick a Color Palette From a Photo
How to build a color scheme from an image, how a palette is found, and how to use the colors in a design, a website or a room.
3 min read
Web & SEO
px vs rem vs em: Which CSS Unit Should You Use?
The difference between px, rem and em in CSS, how to convert between them, and when each one is the right choice.
3 min read
Related tools
Color Palette from Image
Find the main colors in any picture.
CSS Gradient & Box Shadow Generator
Design gradients and box shadows visually and copy the CSS.
PX to REM Converter
Convert px to rem, em, pt and percent for any base font size.
Image Converter
Convert between PNG, JPG and WebP in your browser.