Color Converter (HEX, RGB, HSL, CMYK, Contrast)
Convert colors across HEX, RGB, HSL, and CMYK in real time. Features WCAG 2.1 contrast ratio verification, tints and shades palette generation, and interactive eyedropper screen sampling.
Tints and Shades Palette
Contrast & Accessibility Evaluation
Use this converter to change a color between HEX, RGB, HSL and CMYK, and to check how readable white or black text is on it. Pick a color or type a code in any box, and the other formats update as you type.
How to convert a color between HEX, RGB, HSL and CMYK
- Click the color swatch to open the palette, or type a code into the HEX, RGB or HSL box.
- On a desktop browser that supports it, click Pick from Screen (Eyedropper) to take a color from anywhere on your screen.
- Read the other formats. Each box has a Copy button, so you can paste the value straight into CSS or a design file.
- Check the Tints and Shades Palette for lighter and darker versions of your color.
- Read the Contrast and Accessibility Evaluation to see how white text and black text score on your color.
Want a longer walkthrough? Read our guide on the color converter.
HEX, RGB and HSL: the same color in three ways
Take the orange #FF5733. These three describe exactly the same color:
- HEX: #FF5733. Three pairs of base-16 digits for red, green and blue.
- RGB: rgb(255, 87, 51). The same three values in ordinary numbers from 0 to 255.
- HSL: hsl(11, 100%, 60%). A hue angle on the color wheel, plus saturation and lightness.
HSL is the easiest format to adjust by hand. To make the color lighter, raise the lightness. To make it duller, lower the saturation.
CMYK is an estimate for print
CMYK is the ink system used in printing. The converter calculates it from the RGB values with a standard formula, so #FF5733 gives about 0% cyan, 66% magenta, 80% yellow and 0% black.
A printer’s real result depends on its inks, the paper and its color profile. Treat the CMYK values as a starting point, and ask your printer for their profile or a test print before a large job.
Reading the contrast scores
Contrast is the ratio between the brightness of the text and the background. The Web Content Accessibility Guidelines (WCAG 2.1) ask for at least 4.5:1 for normal text at Level AA, and 3:1 for large text (18 pt, or 14 pt bold). Level AAA asks for 7:1.
On the default color #FF5733, white text scores 3.15:1. That passes only for large text. Black text scores 6.66:1, which passes AA for normal text but falls short of AAA.
The ratio goes from 1:1 (no contrast) to 21:1 (black on white). The converter scores your color against pure white and pure black, so it doesn’t check other text colors.
Tints and shades
A tint is your color mixed with white, which makes a lighter, softer version. A shade is your color mixed with black, which makes a darker version. The palette strip shows both, so you can pick a hover color or a border color from the same family.
What this converter can’t do
It doesn’t manage color profiles, so the same code can look different on different screens. The eyedropper works only in browsers that support it, such as Chrome and Edge, and not in every browser. For brand or print work, confirm the final colors in your design software.
Frequently Asked Questions
What is the difference between HEX and RGB color codes?
They describe the same color. RGB writes the red, green and blue values as numbers from 0 to 255. HEX writes the same three values in base-16, with a leading hash mark.
Why do web designers use HSL?
HSL stands for hue, saturation and lightness. It matches how people think about color, so you can lighten a color by raising the L value, or make it duller by lowering the S value, without recalculating the red, green and blue values.
What contrast ratio does WCAG AA need?
WCAG 2.1 Level AA needs at least 4.5:1 for normal text and 3:1 for large text (18 pt, or 14 pt bold). The converter shows the live score for white text and black text.
Are the CMYK values exact for printing?
No. They are calculated from the RGB values, and a printer's inks, paper and color profile change the printed result. Ask your printer for a test print before a large job.
Can I pick a color from my screen?
Yes, in browsers that support the EyeDropper feature, such as Chrome and Edge on a desktop. You can sample a color from any window or image on your display.
Need more detailed instructions?
Read our comprehensive tutorial for step-by-step guidance, formulas, and tips.