HEX to RGB
Enter a HEX colour code and instantly get the R, G, B channel values and the CSS rgb() function string. Useful for translating design tokens, reading colour values from design files, and writing CSS.
Last updated: May 28, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HEX to RGB?
HEX and RGB are two ways to express the same colour. A HEX code like #3B82F6 encodes the red, green, and blue channels as two hexadecimal digits each. RGB expresses those same channels as decimal integers from 0 to 255.
CSS accepts both formats, but some contexts — canvas drawing, image processing, colour arithmetic — require raw integer values. This tool handles both 3-digit shorthand (#RGB) and 6-digit (#RRGGBB) HEX codes.
How to Use HEX to RGB
Type or paste a HEX code (with or without the # prefix)
The RGB values and css rgb() string appear instantly
Copy the output with the copy button
Common Use Cases
- Frontend developers converting design token hex values to RGB for CSS custom properties or canvas APIs.
- Designers checking the RGB breakdown of a brand colour.
- Developers reading hex values from Figma or Sketch and needing RGB for a JavaScript colour library.
- CSS authors who prefer rgb() over hex for readability or when alpha is needed.
Example Input and Output
Converting the Tailwind blue-500 brand colour from HEX to RGB.
#3B82F6rgb(59, 130, 246)For alpha transparency
If you need rgba() output with an opacity value, use the HEX to RGBA tool.
Browser-side only
Conversion runs locally in your browser.

