Skip to content

RGB to HEX FREE

Type an RGB colour and get the hex string, plus the same colour in HSL, OKLCH and the other notations CSS understands.

Free to use No registration Privacy-first

HEX, rgb(), hsl(), hwb(), oklch(), oklab(), lab(), lch(), color(display-p3 ...) or a CSS colour name.

Recent

Picker and conversions

217°
100%

Every notation

Technical details

Every conversion, palette and contrast figure on this page is computed in your browser. An image you drop in is read on a canvas in this tab and is never uploaded.

How it works

How the conversion is done

Each channel is rounded to a whole number and written as two hexadecimal digits, which is what the browser stores anyway - so the hex you get back is the colour, not a near miss. An alpha below 1 becomes a fourth pair and gives the eight digit form; at 1 you get the usual six.

Both the modern space-separated syntax and the older comma form are accepted, and percentages work in place of 0 to 255. The result is shown beside HSL, OKLCH and the rest, and nothing leaves this tab.

Build a better web, faster.

We build custom software and solutions tailored to your needs.

Get in touch