IZN Tools

HEX to RGB Converter

The three channels behind a hex string, ready for rgb() or a canvas.

#FF5733no CSS keyword
RGBrgb(255, 87, 51)
HEX#FF5733
HSLhsl(11, 100%, 60%)
HSVhsv(11, 80%, 100%)
CMYKcmyk(0%, 66%, 80%, 0%)
Name
Read as HEXCMYK is the naive formula every converter uses — an orientation, not a print specification.
Computed on this device

The conversion is exact

Hex is RGB. #FF5733 is literally FF, 57, 33 read as three base-16 numbers — 255, 87, 51. Nothing is approximated and nothing is lost, in either direction.

That is worth knowing because it is not true of every pair on this site: HSL and CMYK both round, and hex to RGB does not.

Where you need the channels

  • rgba() when you want the same colour at partial opacity — hex alpha exists but is still awkward in older tooling.
  • Canvas and image work, where pixels are three numbers.
  • Anywhere you need to compute: mixing, contrast, or a lightness check all need the channels, not the string.

Shorthand and alpha

#f53 expands to #FF5533 — each digit doubles, which is why only some colours have a three-digit form. An eight-digit #FF573380 is read and the alpha dropped, because rgb() here carries three channels, not four.

Questions

Is anything lost?+

No. Hex and RGB are the same numbers in different bases, so the conversion is exact in both directions — unlike HSL or CMYK, which round.

What about #f53?+

Three-digit shorthand expands by doubling each digit: `#f53` is `#FF5533`. Only colours whose pairs happen to match can be written that way.

Can I get rgba() out of this?+

The alpha in an eight-digit hex is read and dropped, because the other notations here do not carry it. Keep opacity as a separate value.