HEX to RGB converter

To convert HEX to RGB, split the six-digit code into three pairs and read each pair as a base-16 number from 0 to 255: #3B82F6 = rgb(59, 130, 246). Paste any HEX code below to convert it instantly.

Convert HEX, RGB and HSL in one place. Paste a six- or eight-digit HEX code or an rgb() value, preview the swatch with alpha, and copy each format.

How to convert HEX to RGB

Take #2563eb and read the three pairs: 25, 63, and eb. Each pair is base 16, so 25 → 2×16 + 5 = 37, 63 → 6×16 + 3 = 99, and eb → 14×16 + 11 = 235. That gives rgb(37, 99, 235).

HEX#2563eb
RGBrgb(37, 99, 235)
HSLhsl(221, 83%, 53%)

Common colors in HEX, RGB and HSL

ColorInput HEXHEXRGBHSL
White#ffffff#ffffffrgb(255, 255, 255)hsl(0, 0%, 100%)
Black#000000#000000rgb(0, 0, 0)hsl(0, 0%, 0%)
Red#ef4444#ef4444rgb(239, 68, 68)hsl(0, 84%, 60%)
Blue#2563eb#2563ebrgb(37, 99, 235)hsl(221, 83%, 53%)
Green#22c55e#22c55ergb(34, 197, 94)hsl(142, 71%, 45%)
50% transparent black#00000080#00000080rgba(0, 0, 0, 0.502)hsla(0, 0%, 0%, 0.502)

HEX with alpha (8-digit HEX) explained

Standard HEX uses six digits for red, green and blue. Add two more digits for alpha: #00000080 is black at roughly 50% opacity because 80 hex equals 128, and 128÷255 ≈ 0.502. The preview checkerboard behind the swatch shows transparency. In CSS you can paste the same eight-digit HEX or use the copied rgba() value.

HEX to RGB converter FAQs

How do I convert HEX to RGB?

Split a six-digit HEX code into three pairs after the hash. Each pair is hexadecimal (base 16): convert 25 to 37, 63 to 99, and eb to 235 for #2563eb, giving rgb(37, 99, 235).

What is an 8-digit HEX color?

An eight-digit HEX adds two alpha digits at the end, such as #2563eb80 where 80 is the opacity in hex (128 of 255, about 50%). CSS accepts #RRGGBBAA alongside rgb() and rgba().

Should I use RGB or HSL in CSS?

Both work in modern browsers. RGB maps directly from HEX. HSL separates hue, saturation and lightness, which helps when you lighten a brand color without shifting its hue.

Use your color

Drop the copied values into palettes or check contrast before you ship UI. Need a see-through version? Use the HEX to RGBA converter or look up the code in the hex opacity chart.

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools