Hex to RGB Converter
Paste a hex color code to get its RGB value — plus RGB percentages, HSL, HSV, CMYK, OKLCH and the closest named color.
The Hex field is focused below. Type #FF5A36 (3- or 6-digit, with or without #); every other format updates instantly.
| Hex | ||
| RGB | ||
| RGB % | ||
| HSL | ||
| HSV / HSB | ||
| CMYK | ||
| OKLCH | ||
| Closest web-safe | ||
| Closest name | — |
Want harmonies and shades too? Open this color in the full Color Picker.
How to convert hex to RGB
Paste any hex color code into the Hex field (it's focused for you) — 3-digit or 6-digit, with or without the leading #. The RGB value appears instantly in the results table on the right, along with RGB percentages, HSL, HSV/HSB, CMYK, OKLCH, the closest web-safe color and the closest named color. Each value has its own copy button. A 3-digit shorthand like #f53 is expanded to its 6-digit form (#FF5533) before conversion, exactly as a browser would read it.
How a hex code maps to RGB
A 6-digit hex code is three pairs of hexadecimal digits — #RRGGBB — one pair each for red, green and blue. Each pair is a number from 00 (0 in decimal) to FF (255). To read #3B82F6: 3B is 59, 82 is 130, F6 is 246, so the RGB value is rgb(59, 130, 246). In JavaScript the compact version is const n = parseInt(hex.slice(1), 16); const r = (n >> 16) & 255, g = (n >> 8) & 255, b = n & 255;. This converter runs that plus every other format live, with no server round-trip.
Hex to RGB use cases
- Canvas and SVG work — APIs like
fillStyleand many libraries wantrgb()or separate channel numbers, not hex. - Adding transparency — you need the RGB channels to write an
rgba()value with an alpha. - Color math — blending, lightening or comparing colors is easier on 0–255 numbers than on hex strings.
- Non-web tools — game engines, spreadsheets and print software often ask for RGB rather than a hex code.
- Data visualisation — charting libraries frequently interpolate between two
rgb()endpoints to build a colour scale.
Need to go the other way? Use the RGB to hex converter. Want HSL or CMYK from the same hex code? The full color converter shows every format at once. Not sure what the color is called? This page already lists the closest name, or browse the 140 CSS color names.
When RGB is the better format to work in
Hex is compact, but it hides the numbers you need for anything computational. To lighten a color you add the same amount to each RGB channel; to fade one you drop the alpha on an rgba() value; to blend two colors you average their channels. All of that is arithmetic on 0–255 integers, and it is far easier to read and debug than string-slicing a hex code. Graphics APIs reflect this: the HTML canvas, WebGL, most SVG filter primitives and nearly every native UI toolkit take separate red, green and blue components. So the common pattern is to store brand colors as hex for readability, then convert hex to RGB at the moment you feed them to code that does math. Once you have the channels, the color mixer and contrast checker can take the color further.
Reading a hex code without a converter
With a little practice you can estimate an RGB value straight from a hex code. The first pair is red, the second green, the third blue, and each runs from 00 to FF. FF is maximum (255), 80 is roughly half (128), 00 is none. So #FF8000 reads as "all red, half green, no blue" — a saturated orange — and #333333 reads as "a little of everything, equally" — a dark gray. Codes where the two digits in each pair match, like #3366CC, are exactly the colors a 3-digit shorthand (#36C) can represent. For the precise decimal values, and the closest color name, paste the code above; to see the color's shades and harmonies open it in the color picker.
Hex to RGB FAQ
How do you convert a hex code to RGB by hand?
Split the 6 digits into three pairs, then convert each pair from hexadecimal to decimal. #3B82F6 splits into 3B, 82, F6, which are 59, 130 and 246 — so the RGB value is rgb(59, 130, 246).
What is #FFFFFF in RGB?
rgb(255, 255, 255) — pure white, with every channel at its maximum. #000000 is rgb(0, 0, 0), pure black.
Does a 3-digit hex code convert to RGB the same way?
Yes — each digit is doubled first, so #abc becomes #aabbcc, then converts normally to rgb(170, 187, 204). This tool expands shorthand automatically.
What about an 8-digit hex code with alpha?
The last two digits are the alpha channel, also 00–FF. #3B82F680 is rgba(59, 130, 246, 0.5) — the 80 pair is 128, or about 50% opacity. Enter the 6-digit portion here for the opaque RGB value.
Is this hex to RGB converter free?
Yes, completely — no sign-up, no limits, and the conversion runs in your browser so nothing you paste is sent anywhere.