HEX to RGB
Convert hexadecimal color codes (3, 6, or 8 characters) into RGB and RGBA integer values.
rgb(29, 78, 216);
rgba(29, 78, 216, 1);
How to Convert HEX to RGB
Understand the base-16 mathematical transformation that powers hex-to-color mapping in web browsers.
Split Hex Pairs
A 6-digit hex color format is made of three distinct pairs: #RR GG BB. If starting from a shorthand 3-digit hex (#RGB), each digit is doubled (#1D8 becomes #11DD88).
Convert Base-16 to Base-10
Multiply the first hex character by 16 and add the value of the second digit. Hex digits A-F correspond directly to 10-15. For example: 1D = (1×16) + 13 = 29.
Assemble RGB Triplet
Take each resulting decimal integer (bounded between 0 and 255) and assemble into standard CSS syntax: rgb(29, 78, 216) or append alpha for transparent RGBA layers.
Related Developer Utilities
View all developer tools arrow_forwardConvert decimal RGB and RGBA channels back into clean CSS hexadecimal notations.
Translate instantly between HEX, RGB, HSL, HSV, CMYK, and CSS named color profiles.
Compress styles, strip comments, and streamline color strings for production assets.
Strip whitespace, shorten identifiers, and optimize JavaScript code payloads safely.
Convert a hex color
Enter a supported hex color and copy its RGB representation. Enable alpha when an opacity value is needed.
Example
#ff 0000 represents rgb(255, 0, 0).
Before you use the result
Color appearance can vary by screen and color profile; numeric conversion is not a print-color match.