HEX to RGB
Paste a HEX color (with or without the # sign) and we will show you the matching red, green and blue numbers right away.
About the HEX to RGB Converter
A HEX color code packs three numbers into six hexadecimal digits: two for red, two for green and two for blue. This tool unpacks them, so #3498db becomes rgb(52, 152, 219). Each pair maps to a value from 0 to 255, which is the form CSS rgb() functions, canvas APIs and most design tools expect.
How to use it
- Paste a HEX code, with or without the leading
#. - Read the red, green and blue values it returns.
- Drop them into
rgb()or wherever you need numeric channels.
Shorthand three-digit HEX like #39d is expanded by doubling each digit, so it becomes #3399dd. Converting to RGB is handy when you need to build an rgba() value with transparency, since you can reuse the same three numbers and just add an alpha. The math is exact and runs locally in your browser, so your color codes are never sent to a server.
Frequently asked questions
How do I convert a HEX color to RGB by hand?
Split the six digits into three pairs and read each pair as a hexadecimal number from 00 to FF, which equals 0 to 255 in decimal. Those three values are the red, green and blue channels.
Does it accept three-digit shorthand HEX codes?
Yes. A shorthand like #39d is expanded by repeating each digit, giving #3399dd, before it is converted to RGB.
Do I need to include the # symbol?
No. The converter accepts the HEX value with or without the leading hash, so #3498db and 3498db both work.
Is the conversion done online or in my browser?
It runs entirely in your browser. No color code you enter is uploaded or stored.