Color Converter
Convert a color between HEX, RGB, HSL, HSV, CMYK and OKLCH. Type, paste or pick it.
Paste any format: #6366F1, 6366F1, rgb(99 102 241), hsl(239, 84%, 67%), oklch(58.5% 0.204 277), even color: #fff;Read as HEX
Indigo
#6366F1
All formats
Click a copy button, or select a value.
- HEXHexadecimal
#6366F1 - RGBRed, green, blue
rgb(99, 102, 241) - HSLHue, saturation, lightness
hsl(239, 84%, 67%) - HSV / HSBHue, saturation, value
hsv(239, 59%, 95%) - CMYKPrint inks
cmyk(59%, 58%, 0%, 5%) - OKLCHPerceptual, modern CSS
oklch(58.54% 0.2041 277.12)
Every color is stored as an sRGB HEX code, so values are rounded to what HEX can hold, and OKLCH colors outside sRGB are brought into range. CMYK here is a plain formula, not a printer profile, so check print colors with your printer.
About the Color Converter
How to convert colors between HEX, RGB, HSL, HSV, CMYK and OKLCH, and when to use each format.Read the guideHide guide
The ColorOverflow Color Converter is a free online tool for converting color codes. Type or paste a color in any common format, such as a HEX code, rgb(), hsl() or oklch(), and it shows the same color in every other format, each with a copy button. You can also pick a color with the color picker.
It's built for pasting: the # is optional, short HEX codes like #FFF work, commas or spaces both work, and you can paste a whole CSS line such as color: #6366F1;. It runs in your browser with no sign-up.
How to convert a color
- Enter your color. Paste a code in any supported format, type it, or click the swatch to pick a color.
- Check how it was read. The label under the field shows which format the converter recognized.
- Copy the format you need. Each row has its own copy button, or use Copy all to copy every format at once.
Supported color formats
- HEX: a six-digit hexadecimal code such as #6366F1, or the three-digit short form such as #FFF. The most common format in CSS and design tools.
- RGB: red, green and blue channels from 0 to 255, such as rgb(99, 102, 241). Percentages and the space-separated CSS syntax work too.
- HSL: hue in degrees, then saturation and lightness as percentages, such as hsl(239, 84%, 67%). Handy for making a color lighter or darker by hand.
- HSV or HSB: hue, saturation and value (also called brightness), the model most color pickers in design apps use.
- CMYK: cyan, magenta, yellow and black ink percentages, used for print.
- OKLCH: lightness, chroma and hue in the OKLab color space, supported in modern CSS. Equal steps in lightness look equally different to the eye, which makes it good for building color scales.
Which format should I use?
- For websites and apps, HEX and RGB work everywhere. Use rgb() when you need transparency, such as rgb(99 102 241 / 50%).
- Use HSL or OKLCH when you want to adjust a color by hand, since lightness is its own number.
- Use OKLCH for design systems and color scales in modern CSS, when you want steps that look even.
- Use CMYK only as a starting point for print, and confirm colors with your printer.
Frequently asked questions
- How do I convert HEX to RGB?
- Paste the HEX code into the converter and copy the RGB row. Each pair of HEX digits is one channel in base 16: #6366F1 is red 99, green 102 and blue 241.
- Why does converting back give a slightly different HEX code?
- HSL, HSV and CMYK are shown as whole numbers, so they hold a little less detail than a HEX code. Turning a rounded value back into HEX can move a channel by a few steps out of 255, a difference you won't see. Copy the HEX or RGB value when you need the exact color.
- Does it support transparency?
- You can paste colors with an alpha value, such as rgba() or rgb(… / 50%), and the converter reads the color, but it ignores the transparency and shows every format at full opacity.
- Is the CMYK value exact for print?
- No. It uses the standard formula from RGB, not a printer's color profile, so printed colors can differ. Treat it as a starting point and check with your printer.
- What happens to OKLCH colors outside the screen's range?
- OKLCH can describe colors that ordinary sRGB screens can't show. The converter brings those into the sRGB range, so the HEX and other values are the closest color it can show.
