HEX to RGB
Convert a hex colour code to RGB in your browser, with the shorthand and alpha forms handled.
Runs in your browser
Enter a colour.
What the six digits are
A hex colour is three bytes written in base 16: two digits for red, two for
green, two for blue, each running 00 to ff — that is, 0 to 255.
#b8380f is red b8 (184), green 38 (56), blue 0f (15).
That is the whole encoding. It is not a colour space of its own, and there is nothing to convert in the sense that HSL or CMYK need converting — hex and RGB are the same three numbers written two ways.
The shorthand
#fff is #ffffff. Each digit is doubled, not padded: #abc is
#aabbcc, not #0a0b0c.
That doubling means only 4,096 colours can be written in shorthand, which is why
#b8380f has no three-digit form.
Alpha
#rrggbbaa adds transparency as a fourth byte, and #rgba is its shorthand.
#ffffff80 is white at about 50% — 80 is 128 of 255.
Support is universal in current browsers, but the byte is a 0–255 value
where CSS rgb() takes a 0–1 fraction, which is a common source of
confusion when converting by hand.
Nothing is uploaded
Converted in this page.