About this tool
HEX and RGB are two notations for the same sRGB color. RGB notation is often easier to manipulate programmatically — channels are plain integers you can tween, mix or compare.
Use it when a stylesheet expects rgb() syntax, or when you need channel values for canvas and WebGL code.
Shorthand (#39f) and 8-digit alpha hex (#394dfe80) are both accepted.
Frequently asked questions
How do I convert a hex color to RGB?
Split the six-digit hex into three pairs and convert each from hexadecimal to a 0–255 decimal. For #394DFE: 39 becomes 57, 4D becomes 77, FE becomes 254 — giving rgb(57, 77, 254). Paste any 3-, 6- or 8-digit hex here and the RGB values appear instantly.
What formats are accepted?
#rgb, #rrggbb and #rrggbbaa — with or without the leading hash.
What about alpha?
8-digit hex values convert to rgba() output with the alpha as a 0–1 decimal.
Is any precision lost?
The R, G and B channels map exactly 1:1 — each hex byte is an integer 0–255. Alpha from 8-digit hex is divided by 255 and rounded to two decimals for readability (80 → 0.5), so the decimal alpha is a close approximation rather than an exact value.