WorkingFigures

Converters

Hex to RGB converter

Type a hex colour and read it as rgb(), with a live preview swatch. Short #1af, standard #11aaff and alpha #11aaff80 forms all work, and nothing leaves your browser. Need HSL instead? That is one click away below.

⇄
RGB
rgb(17, 170, 255)

Text is processed by your own browser and never leaves your device: this page has no server to send it to.

How it works

Each pair of hex digits is one channel from 00 to ff, so #11aaff is red 17, green 170, blue 255. Three and four digit forms double each digit (#1af is #11aaff), and an 8-digit hex carries alpha, which comes out as rgba() and hsla(). The HSL line is computed from the same RGB values.

Frequently asked questions

What do #1af and #11aaff have in common?

They are the same color: in the short form every digit is doubled. The short form only exists for colors whose channels repeat a digit, which is why not every color has one.

What is the fourth pair in an 8-digit hex?

Alpha, the opacity channel: 00 is transparent and ff opaque. The tool converts #11aaff80 to rgba() with alpha 0.5 and the preview swatch reflects it.

When should I use HSL instead?

When you design by adjusting: HSL separates hue from saturation and lightness, so making a hover state 10% darker is a single number change instead of recomputing three channels.

Other text tools