Color

HEX to RGB Converter

Move a color between HEX, RGB, and HSL — type any format or pick one visually, and copy whichever your code needs.

HEX#4F46E5
RGBrgb(79, 70, 229)
HSLhsl(243, 75%, 59%)

How it works

A color has one value written three ways. HEX packs the red, green, and blue channels into six hex digits (#RRGGBB). RGB lists those same channels as three numbers from 0 to 255. HSL describes the color as hue, saturation, and lightness instead — often easier to tweak by hand.

Change any input and the others follow, because they all describe the same point in color space. The swatch shows the result live, and the native picker lets you nudge the color visually until it's right.

Which format you copy depends on the job: HEX is compact for CSS, RGB is handy when you need an alpha channel with rgba(), and HSL makes it easy to build lighter or darker variants by adjusting lightness.

Frequently asked questions

How do I convert HEX to RGB?

Split the six hex digits into three pairs and read each as a number from 0 to 255. #4F46E5 becomes rgb(79, 70, 229). The converter does it instantly — just type or paste the hex code.

What is HSL and why use it?

HSL stands for hue, saturation, and lightness. It's useful because you can keep the same hue and just raise or lower the lightness to make tints and shades, which is harder to do in HEX or RGB.

Can I convert RGB back to HEX?

Yes, it works both ways. Change any of the R, G, or B fields and the HEX and HSL values update to match, so you can start from whichever format you have.