Image Color Lab

Converter

Color code converter

Paste a hex, rgb() or hsl() value and read the same color as HEX, RGB, HSL, CMYK and OKLCH. Every conversion runs locally, so nothing is sent anywhere.

Accepts #hex, rgb(59 130 246), hsl(217 91% 60%) or three numbers.

blue

—

HEX

—

RGB

—

HSL

—

CMYK

—

OKLCH

—

Same color, every notation

HEX writes the red, green and blue channels as three hexadecimal pairs. RGB uses 0–255 values. HSL describes hue, saturation and lightness, which is easier to adjust by hand. CMYK is the subtractive model used for print. OKLCH is a perceptually uniform space where equal lightness steps look equal, and it is now supported by modern CSS.

Conversion is deterministic arithmetic, so the tool runs it in your browser with no request. Copy any row, or head back to theimage color picker to sample a color from a file instead of typing one.

Which notation to use, and when

HEX is the shortest form and the one HTML, CSS and nearly every design tool accept, so it is the default for a stylesheet. A three-digit shorthand such as #fb0 only exists when each pair repeats the same digit (#ffbb00), and an eight-digit form appends alpha (#3b82f680). rgb() and the newer space syntax, rgb(59 130 246 / 0.5), make alpha explicit and are easier to generate from code. hsl() keeps hue, saturation and lightness apart, which makes it easier to nudge by hand, and oklch() spaces lightness evenly enough to build a gradient that does not band.

CMYK is for ink on paper, not for screens: this converter uses the plain formula, while a real print job needs the press profile and the paper stock. Treat the CMYK row as a starting point to discuss with a printer, not as the final value.

The same blue is #3b82f6, rgb(59 130 246) and hsl(217 91% 60%); none is more correct than the others, they describe one color three ways. The last digit can differ after a round trip, because HSL and OKLCH round at every step, so convert once from the original and copy the result instead of chaining conversions. If a code has four or eight digits, the extra pair is opacity, not a fourth color channel.