How to use the Hex to RGB Converter
Paste a hex colour code such as #3B82F6. You get the rgb() value, the plain channel numbers and the HSL equivalent.
How hex to RGB conversion works
A six-digit hex code holds three pairs: red, green and blue. Each pair is converted from base 16 to base 10. In #FF5733, FF is 255, 57 is 87 and 33 is 51, giving rgb(255, 87, 51).
Three-digit hex codes
Short codes double each digit, so #F53 means #FF5533. Expand the short form first if a tool only accepts six digits.
How it works
Split the hex code into red, green and blue pairs.
Examples
- #3B82F6
rgb(59, 130, 246) RGB values: 59, 130, 246 hsl(217, 91%, 60%)
- #FF5733
rgb(255, 87, 51) RGB values: 255, 87, 51 hsl(11, 100%, 60%)
- #000000
rgb(0, 0, 0) RGB values: 0, 0, 0 hsl(0, 0%, 0%)
Common hex colours in RGB
| Hex | RGB |
|---|---|
| #000000 | rgb(0, 0, 0) |
| #FFFFFF | rgb(255, 255, 255) |
| #FF0000 | rgb(255, 0, 0) |
| #00FF00 | rgb(0, 255, 0) |
| #0000FF | rgb(0, 0, 255) |
| #FFFF00 | rgb(255, 255, 0) |
| #00FFFF | rgb(0, 255, 255) |
| #FF00FF | rgb(255, 0, 255) |
| #808080 | rgb(128, 128, 128) |
| #FFA500 | rgb(255, 165, 0) |
| #800080 | rgb(128, 0, 128) |
| #000080 | rgb(0, 0, 128) |
Limitations and assumptions
Runs entirely in your browser. Nothing you enter is uploaded.
Frequently asked questions
What is #000000 in RGB?
rgb(0, 0, 0), which is black.
Can I use the RGB result in CSS?
Yes. Copy the rgb() value straight into a stylesheet; browsers render it exactly like the hex code.
How do I convert RGB back to hex?
Use the RGB to hex converter.