HEX to RGB Color Converter
Enter a 3- or 6-digit HEX color and get its RGB values instantly, with a live swatch preview and a one-click copy.
Works with #RGB, RGB, #RRGGBB, or RRGGBB. Converts as you type.
Result
rgb(11, 95, 255)
HEX: #0B5FFF
How HEX to RGB conversion works
A HEX color like #1D4ED8 is three numbers packed together: the first two characters are the red channel, the middle two are green, and the last two are blue. Each pair is written in base-16 (hexadecimal), where the digits run 0–9 and then A–F for 10–15. RGB writes the same three channels as ordinary base-10 numbers from 0 to 255.
To convert a pair, multiply the first digit by 16 and add the second. For #1D4ED8: red is 1D = 1 × 16 + 13 = 29; green is 4E = 4 × 16 + 14 = 78; blue is D8 = 13 × 16 + 8 = 216. So #1D4ED8 is rgb(29, 78, 216). The highest pair, FF, is 15 × 16 + 15 = 255 — which is why every RGB channel tops out at 255.
Shorthand 3-digit codes are a compact way to write colors whose pairs repeat: #18F means #1188FF. You may also see 8-digit codes like #1D4ED880 — the last pair is transparency (alpha), not part of the color itself, so this tool reads only the first six digits' worth of color.
Common HEX to RGB values
Click any row to load it into the converter.
| Color | HEX | RGB |
|---|---|---|
| White | #FFFFFF | rgb(255, 255, 255) |
| Black | #000000 | rgb(0, 0, 0) |
| Red | #FF0000 | rgb(255, 0, 0) |
| Lime green | #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) |
| Gray | #808080 | rgb(128, 128, 128) |
| Silver | #C0C0C0 | rgb(192, 192, 192) |
| Navy | #000080 | rgb(0, 0, 128) |
| Orange | #FFA500 | rgb(255, 165, 0) |
Where you'll use RGB values
HEX is the most common way to share a color, but plenty of places ask for RGB instead: CSS (rgb(29, 78, 216)), design apps like Photoshop, Figma, and Canva, slide software, and spreadsheet cell colors. RGB is also easier to adjust by hand — raising one channel shifts the color toward red, green, or blue in a way that's hard to see in a HEX code.
One caution: RGB describes light on a screen, not ink or paint. If you're matching a screen color to something physical, use the Paint Color Matcher to find the nearest real paint, then check a physical sample before buying.
HEX to RGB FAQ
How do you convert HEX to RGB?
A HEX code splits into three two-digit pairs after the #, one each for red, green, and blue. Each pair is read as a base-16 (hexadecimal) number and converted to its base-10 equivalent (0-255) — for example, #1D4ED8 becomes RGB(29, 78, 216).
Does a shorthand 3-digit HEX code work the same way?
Yes. A shorthand code like #18F doubles each digit before converting, so it expands to #1188FF, then converts the same way as a standard 6-digit code.
What's the difference between HEX and RGB?
Nothing about the color itself — they're two ways of writing the same red, green, and blue amounts. RGB writes each channel as a number from 0 to 255; HEX writes the same numbers in base-16 so the whole color fits in six characters. #FF0000 and rgb(255, 0, 0) are the same red.
Can I find a real paint that matches a HEX color?
Yes. Paste the HEX code into the Paint Color Matcher, which compares it against thousands of real colors from brands like Behr, Benjamin Moore, and Sherwin-Williams and shows the closest match from each. Screens and paint never look exactly alike, so always check a physical sample.