How to convert HEX to RGB
Convert HEX color codes to RGB instantly. Enter a HEX or RGB value, or use the sliders, and every format updates at once, with a live preview, the formula and a table of common colors.
- Type or paste a HEX value, such as #3B82F6, into its field above.
- The RGB value updates immediately: #3B82F6 is rgb(59, 130, 246). The other formats and the color preview update too.
- Copy the RGB value into your CSS, design tool or code.
The HEX to RGB formula
A HEX color is three pairs of hexadecimal digits: red, green and blue. Convert each pair from base 16 to base 10 to get the RGB channels:
#3B82F6 → rgb(59, 130, 246)
Common colors in HEX and 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) |
#3B82F6 | rgb(59, 130, 246) |
HEX and RGB explained
A HEX color is a # followed by six hexadecimal digits: two each for red, green and blue, from 00 (none) to FF (full). It is the most common way to write colors in CSS and design tools.
RGB gives the red, green and blue channels as numbers from 0 to 255, as in rgb(59, 130, 246). It is the model screens use to mix light.
Frequently asked questions
Does converting change the color?
HEX, RGB and HSL describe the same screen colors, so converting between them is exact (HSL is rounded to whole numbers). CMYK is for print: the printed result depends on the printer's color profile, so treat screen-to-CMYK values as a starting point.
Can I use the result in CSS?
Yes. CSS accepts hex (#3B82F6), rgb(59, 130, 246) and hsl(217, 91%, 60%) directly. CMYK is not a CSS format; it is used in print and design software.
What about transparency?
Add an alpha value: 8-digit hex (#3B82F680) or rgba()/hsla() in CSS. The converter works with the solid color; the alpha value stays the same in every format.
Is this tool free?
Yes, it's free to use. No signup, no email required. Get results on this page.
How do I get my result?
Use the tool on this page. Your result appears here; no email delivery is required.