Turn red, green, and blue channel values into six-digit HEX color codes for CSS, design systems, and web interfaces.
Last updated: March 2026 | By Workshelve Team
RGB starts with three decimal channel values: red, green, and blue. In this converter each channel must be a whole number from 0 to 255. RGB(255, 100, 50), for example, describes a color with maximum red, a mid-low green value, and a smaller amount of blue.
A six-digit HEX color stores those same three channels as hexadecimal pairs in the order #RRGGBB. Each decimal channel is converted independently to a two-character value from 00 to FF. RGB(255, 100, 50) therefore becomes FF, 64, and 32, producing #FF6432.
Leading zeroes matter when building the final code. A channel value of 12 converts to hexadecimal C, but its HEX color pair must be 0C. This tool pads every channel to two digits and returns a normalized six-digit uppercase HEX code.
Worked example: RGB(255, 100, 50)
Enter whole numbers from 0 to 255 for red, green, and blue. All three channels are required before a HEX result can be calculated.
One 8-bit RGB channel has 256 possible values. Two hexadecimal digits also provide 256 combinations, from 00 through FF, so one pair represents one channel exactly.
A HEX color reserves two characters for every channel. Decimal 12 is hexadecimal C, so the red, green, or blue pair is written as 0C to preserve the #RRGGBB structure.
Yes. RGB input is returned as a normalized six-digit #RRGGBB value, even when the same color could also be written with three-digit HEX shorthand.
The converter reports the value as invalid. It does not silently clamp out-of-range channels, because standard 8-bit RGB channels must stay between 0 and 255.
Yes. The inputs are interpreted specifically as red, green, then blue, and the output preserves that order as RR, GG, then BB. Swapping channels changes the color.
Decimal 255 converts to FF, while decimal 0 converts to 00. Keeping the red, green, blue order gives FF + 00 + 00, so the final color code is #FF0000.
No. RGB and HEX are two notations for the same three 8-bit channel values. Converting the notation does not alter the underlying red, green, or blue intensities.
Related Tools
Convert pixels to inches.
Convert roman numerals values.
Convert between kilobytes and megabytes.
Convert letters to numbers.
Convert between megabytes and gigabytes.
Convert between megabits and gigabits per second.