100% in your browser β€” no upload

HEX to RGB Converter

Use this HEX to RGB converter to turn any hex code like #3b82f6 into red, green and blue values and a ready-to-paste rgb() string. The conversion runs in your browser, with nothing uploaded and no sign-up.

Runs in your browser No upload 6 formats + picker OKLCH & modern CSS

Pick or paste a color

Edit any field — HEX, RGB, HSL, HSV, CMYK or OKLCH — and the rest update instantly. Copy the CSS string you need.

HEX
RGB
HSL
HSV
CMYK
OKLCH

How to convert HEX to RGB

1

Enter your hex code

Type or paste a hex value such as #3b82f6 into the HEX field, with or without the leading hash.

2

Read the RGB values

The R, G and B numbers update instantly, and you also see HSL, HSV, CMYK and OKLCH for the same color.

3

Copy the rgb() string

Copy the result as a CSS-ready value like rgb(59 130 246) and paste it straight into your stylesheet.

Why convert HEX to RGB

HEX codes are compact and common in design tools, but rgb() is often easier to work with when you want to read or adjust the individual channels, or add transparency with an alpha value. This HEX to RGB converter does the math both ways, so you can also edit the RGB fields and read back the matching hex.

Because the conversion is exact integer math on the three channels, the round trip between HEX and RGB is lossless. Everything happens on the page in your browser, so it stays fast and your colors are never sent anywhere.

Frequently asked questions

How do I convert a hex code to RGB?

Paste the hex value into the HEX field and read the R, G and B numbers, which update instantly. You can also copy the full rgb() string.

Does it work with 3-digit hex like #abc?

Yes. Short hex codes are expanded to their full 6-digit form before converting to RGB.

Can I go from RGB back to HEX here?

Yes, the converter is two-way. Edit the RGB fields and the matching hex updates automatically.

Is HEX to RGB conversion lossless?

Yes. Both formats describe the same 8-bit sRGB channels, so converting between HEX and RGB does not change the color.

Is my color data uploaded anywhere?

No. The HEX to RGB conversion runs entirely in your browser with no upload and no sign-up.

Related tools