HEX to RGB Converter
Processed Client SidePaste a hexadecimal color — 3, 4, 6, or 8 digits — and instantly get its rgb() and rgba() values, with a live preview.
Bookmark this tool now — skip the search next time you need it.
About HEX to RGB converter
This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.
Paste a hexadecimal colour and get its rgb() and rgba() equivalents, along with the individual red, green, blue, and alpha channel values and a live swatch of the result. It accepts every hex form CSS allows — three digits, four digits with alpha, six digits, and eight digits with alpha — so #f80, #ff8800, and #ff8800cc all resolve correctly. When the colour includes an alpha channel the output switches to rgba() automatically. There is also a native colour picker, so you can go the other way: pick a colour visually and read off both the hex and the RGB values.
Key features
- Accepts 3, 4, 6, and 8-digit hex, with or without the leading hash
- Outputs rgb(), and switches to rgba() automatically when the colour carries an alpha channel
- Individual R, G, B, and A channel values listed separately for when you need the numbers, not the string
- Live colour swatch, rendered over a checkerboard when the colour is partly transparent
- Built-in colour picker for choosing a colour visually and reading its hex and RGB values
- Invalid input is flagged immediately rather than silently rendering black
- One-click copy of the CSS-ready value
- Runs entirely in your browser
How to use it
- Type or paste your hex colour into the input field.
- Read the rgb() or rgba() result, with the individual channel values listed below it.
- Check the swatch to confirm it is the colour you expected.
- Use the colour picker instead if you want to choose visually.
- Copy the CSS-ready value.
Tips & common mistakes
- Shorthand hex simply doubles each digit: #f80 is exactly #ff8800. It is not an approximation, so use whichever form is more readable.
- Eight-digit hex puts alpha last as two hex digits — #ff8800cc is about 80% opaque. Safari was the last holdout on support and has handled it for years now.
- RGB values are what you need when interpolating colours in JavaScript or animating between them; hex is a string and cannot be averaged directly.
- Alpha is a fraction from 0 to 1 in rgba() but two hex digits from 00 to ff in eight-digit hex. 80 in hex is 50% opacity, not 80%.
- For a colour that needs to sit on an opaque background, prefer a solid hex over an alpha value — transparency composites differently over each background it lands on.
- If you are picking colours for a design system, look at HSL or OKLCH instead: they let you hold hue steady and vary lightness predictably, which RGB does not.
- Converting the other direction? RGB to HEX converter goes from `rgb()` back to a hex code.
- Want the same color expressed in the perceptually uniform OKLCH space? Convert it with HEX to OKLCH converter.