Colour Format Converters

31 converters, all running in your browser.

Four colour models cover almost all practical work, and each exists because it answers a different question.

HEX and RGB are the same thing written differently: three channels of 0–255, which is how a screen physically emits colour. HEX is more compact; RGB is easier to compute with. Neither is intuitive to adjust by hand — making a colour "slightly lighter" means changing three numbers in a way that is not obvious.

HSL and HSB exist for exactly that reason. Hue, saturation and lightness map onto how people describe colour, so building a ramp means changing one number. This is why design tools work in HSL even when they export HEX.

CMYK is subtractive: it describes ink on paper rather than light from a screen. Its gamut is smaller than RGB's, so saturated screen colours have no exact ink equivalent and any RGB-to-CMYK conversion is an approximation. For brand-critical print, specify a Pantone reference and let the printer match it.

All 31 converters

What Each Conversion Costs

Some colour conversions are lossless and some are not, and knowing which is which prevents a class of frustration.

HEX ↔ RGB is lossless in both directions. They encode the same three channels; only the notation differs.

RGB ↔ HSL is lossless in principle and lossy in practice, because both are usually stored as integers. Round-tripping #1E90FF through HSL and back can land a digit away, which matters if you are comparing strings rather than colours.

RGB → CMYK is lossy and irreversible. The CMYK gamut is smaller, so saturated screen colours have no ink equivalent — the conversion picks the nearest printable colour and the original is not recoverable.

Alpha and the Eight-Digit HEX

Modern CSS accepts #RRGGBBAA, adding a two-digit alpha channel, and #RGBA as shorthand. The values are hexadecimal, so 50% opacity is 80, not 50:

OpacityHex
100%FF
75%BF
50%80
25%40
0%00
rgba() and hsla() take alpha as a decimal from 0 to 1 instead, which is why the same transparency is written 0.5 in one place and 80 in another.

Wide Gamut Is Arriving

display-p3 and oklch cover colours sRGB cannot express, and browser support is now broad. OKLCH in particular is worth knowing: it is perceptually uniform, so equal changes in its lightness value look like equal changes, which HSL does not manage. Building a ramp in OKLCH gives evenly-spaced steps without adjusting by eye.

← All color converter (hex, rgb, hsl) categories