Color Converters
Convert between HEX, RGB, HSL, HSV, CMYK and OKLCH — live, with one-click copy.
RGB to CMYK Converter
Convert RGB (screen) to CMYK (print) plus HEX, HSL, HSV, OKLCH.
HEX to RGB Converter
Convert a HEX color code to RGB (and HSL, HSV, CMYK, OKLCH). Live picker, copy any format.
RGB to HEX Converter
Convert RGB values to a HEX color code (and HSL, HSV, CMYK, OKLCH). Live picker, copy any format.
RGB to OKLCH Converter
Convert RGB to OKLCH (perceptually-uniform CSS color) plus HEX, HSL, HSV, CMYK.
HEX to OKLCH Converter
Convert HEX to OKLCH — the perceptually-uniform color space used in modern CSS. Plus RGB, HSL, HSV, CMYK.
RGB to HSL Converter
Convert RGB to HSL plus HEX, HSV, CMYK, OKLCH. Live picker.
HEX to HSL Converter
Convert HEX to HSL (hue, saturation, lightness) plus RGB, HSV, CMYK, OKLCH.
HEX to CMYK Converter
Convert a HEX color to CMYK for print, plus RGB, HSL, HSV, OKLCH.
Color converters: one engine, eight starting points
Every one of these color converters accepts the same inputs, a HEX code, rgb(), hsl(), hsv(), cmyk() or oklch(), or a pick from the native colour control, and shows every other notation at once with a copy button on each. The eight pages differ in which conversion they explain, so pick the page for the question you have rather than the input you hold.
- HEX to RGB is the one for transparency: a hex code is opaque, and once you have the channels you can write rgb(59 130 246 / 50%) or store them as a space-separated CSS variable and reuse it at any opacity. Three-digit shorthand is expanded by doubling each digit, and an 8-digit code has its alpha dropped.
- RGB to HEX goes the other way, always emitting six uppercase characters, with out-of-range channels clamped to 0 to 255 and any alpha discarded.
- HEX to HSL and RGB to HSL give you hue, saturation and lightness for building tints and shades by changing one number. HSL is reported in whole degrees and percent, which is why a round trip can land a step or two off: #3B82F6 becomes hsl(217, 91%, 60%) and returns as #3C83F6. Greys come back with hue 0, which means nothing when saturation is 0.
- HEX to OKLCH and RGB to OKLCH report the perceptually uniform space modern CSS supports, L and C to four decimals and hue to two. Equal L values look equally light, which HSL cannot promise, so OKLCH is the space to build a colour ramp in. OKLCH lightness is still not a WCAG contrast ratio; check pairs separately.
- HEX to CMYK and RGB to CMYK apply the plain formula with no ICC profile, no paper and no ink limit. Pure black comes out as 0, 0, 0, 100 rather than a rich black, and vivid greens and oranges return numbers that will print duller than they look. Use them to fill a field or understand the relationship, then let the print shop convert with their own profile.
For picking a colour rather than converting one, checking a text and background pair, or generating a palette, see the color tools.