Color Format Converter
Paste one color in any of four notations and this converter writes it back out as HEX, RGB, HSL and CMYK, plus the CSS keyword when one matches exactly. A swatch shows the result, and a native color picker is there if you would rather click than type. It is aimed at the everyday job of moving a brand color from a design file into a stylesheet, or turning a token in hsl() back into the hex your tooling expects.
How to convert a color
- Type or paste a color into Enter Color. It accepts
#3b82f6,3b82f6or the three-digit#38f,rgb(59, 130, 246),hsl(217, 91%, 60%), or a CSS name such ascoral. - Or click the small color picker under the field. The text field and swatch update to the picked value.
- Read the five rows: HEX, RGB, HSL, CMYK and Named Color. Named Color shows N/A unless the color is exactly one of the CSS keywords in the built-in list.
- Click Copy beside a row to put that value on the clipboard. The button briefly reads Copied!.
What the conversions do and do not guarantee
HEX and RGB are the same numbers in different bases, so that conversion is exact. HSL is derived from RGB and then rounded to whole degrees and whole percents, which means a round trip through HSL can move a channel by a few units. If you need the exact original, keep the HEX.
The CMYK row uses the plain formula K = 1 minus the largest of R, G and B, with C, M and Y scaled from what is left. It has no ink profile, so it will not match what a press produces. Treat it as a starting point for print work and check it in a color-managed tool.
Input is strict. rgb() and hsl() must use the comma syntax with whole numbers, so the modern space-separated rgb(59 130 246), decimals, and alpha values are rejected, and CMYK cannot be typed in even though the error message mentions it. Where two keywords share a value, such as aqua and cyan, the Named Color row shows the one listed first (aqua). Channels above 255 are not clamped and produce a broken HEX, so keep values in range.