How to convert HEX to RGB
- Remove the # and, for a 3-digit code, double each digit (#f60 becomes ff6600).
- Split the code into three pairs: red, green and blue.
- Convert each pair from hexadecimal to decimal: ff = 15 × 16 + 15 = 255, 66 = 6 × 16 + 6 = 102, 00 = 0.
- Write the result as rgb(255, 102, 0). An optional fourth pair is the alpha: divide it by 255.
What a HEX code really is
A HEX color code is simply RGB written in base 16. Each pair of digits holds one channel, from 00 (none of that light) to ff (full strength), which is 0 to 255 in everyday numbers. Because both formats store exactly the same information, converting HEX to RGB is lossless: every HEX code has exactly one RGB value and back again.
Designers like HEX because it is short and easy to copy from tools such as Figma or Photoshop. Developers often need RGB instead, for example to add transparency with rgba() or to calculate colors in code. That is the most common reason to convert.
Short codes and transparency
CSS allows a 3-digit shorthand when each pair has two identical digits: #f60 is the same as #ff6600, and #fff is white. A 4-digit or 8-digit code adds an alpha channel for transparency. #ff660080 is orange at 128 out of 255, about 50% opacity, which this converter shows as rgba(255, 102, 0, 0.5).
Case does not matter: #FF6600 and #ff6600 are identical. The # sign is optional when you paste a code here, but it is required when you write HEX colors in CSS.
Where you will meet HEX codes
HEX codes appear in website stylesheets, email templates, presentation themes and the color fields of almost every design app. Brand guides often list a HEX code next to each color. When a program asks for separate red, green and blue numbers instead, such as a spreadsheet chart, a video editor or a smart light app, converting to RGB gives the three values in one step.
Remember that the converter also shows HSL, HSV and CMYK for the same color, so you can copy whichever format the next program needs.
HEX to RGB chart of common colors
HEX to RGB values for common colors| Color | HEX | RGB |
|---|
| Black | #000000 | rgb(0, 0, 0) |
| White | #ffffff | rgb(255, 255, 255) |
| Red | #ff0000 | rgb(255, 0, 0) |
| Lime | #00ff00 | rgb(0, 255, 0) |
| Blue | #0000ff | rgb(0, 0, 255) |
| Yellow | #ffff00 | rgb(255, 255, 0) |
| Cyan | #00ffff | rgb(0, 255, 255) |
| Magenta | #ff00ff | rgb(255, 0, 255) |
| Silver | #c0c0c0 | rgb(192, 192, 192) |
| Gray | #808080 | rgb(128, 128, 128) |
| Maroon | #800000 | rgb(128, 0, 0) |
| Olive | #808000 | rgb(128, 128, 0) |
| Green | #008000 | rgb(0, 128, 0) |
| Purple | #800080 | rgb(128, 0, 128) |
| Teal | #008080 | rgb(0, 128, 128) |
| Navy | #000080 | rgb(0, 0, 128) |
| Orange | #ffa500 | rgb(255, 165, 0) |
| Tomato | #ff6347 | rgb(255, 99, 71) |
Other colors: use the converter above or the Color Converter.