Decode 3-digit or 6-digit hexadecimal color codes into decimal red, green, and blue channel values for CSS and digital design.
Last updated: August 2026 | By Workshelve Team
HEX and RGB are two notations for describing colors made from red, green, and blue light. A six-digit HEX color has the structure #RRGGBB. The first pair represents red, the second green, and the third blue.
HEX uses base 16, so each digit can be 0–9 or A–F. A two-digit HEX pair ranges from 00 to FF, which corresponds exactly to decimal values from 0 to 255. That is why every #RRGGBB color maps directly to an RGB value such as rgb(6, 182, 212).
Three-digit HEX is shorthand. A value such as #0CF expands by repeating each digit: #00CCFF. This converter performs that expansion before calculating the RGB channel values.
A six-digit HEX color is a compact way to store three color channels. In #RRGGBB, RR is red, GG is green, and BB is blue. Each pair is a base-16 number from 00 through FF, and this converter decodes those pairs into familiar decimal RGB values from 0 through 255.
HEX input is case-insensitive, so #7C3AED and #7c3aed describe the same color. The # prefix is optional, and this converter also accepts a leading 0x prefix. The result is shown as separate red, green, and blue numbers plus standard CSS rgb(r, g, b) notation.
Three-digit HEX uses shorthand rather than three full channel pairs. A code such as #0CF expands to #00CCFF by repeating each digit before conversion. That expansion is important: 0 becomes 00, C becomes CC, and F becomes FF.
Worked example: #06B6D4
The converter accepts three-digit #RGB shorthand and six-digit #RRGGBB colors. The # prefix is optional, and a leading 0x prefix is accepted as an alternative.
Each digit is repeated to form a full channel pair. #0CF becomes #00CCFF, so its RGB channels decode to 0, 204, and 255.
No. Hexadecimal digits A–F are case-insensitive, so #7C3AED and #7c3aed decode to the same red, green, and blue values.
B represents 11 in base 16. B6 therefore equals 11 × 16 + 6, which is 182. The same calculation is applied to the other two channel pairs.
Leading zeroes are significant placeholders in a two-digit channel. For example, 06 is decimal 6, while 60 is decimal 96, so reversing those digits changes the color.
The converter shows a validation error. After an optional prefix is removed, the color must contain exactly 3 or 6 hexadecimal digits using only 0–9 and A–F.
Yes. Along with the three decimal channel values, the converter provides standard rgb(r, g, b) notation suitable for CSS color properties.
No. This tool is limited to opaque three-digit and six-digit HEX colors. Eight-digit #RRGGBBAA values include an alpha channel and are not accepted.
Related Tools
Convert number base values.
Convert Base64 encoded data into hexadecimal values.
Convert hexadecimal values into Base64 encoded data.
Convert binary values into hexadecimal numbers.
Convert hexadecimal values into binary numbers.
Convert CMYK color values into HEX color codes.