Tech
Hex to RGB Converter
Convert hex color codes to RGB, HSL, and CMYK with live color preview and reverse RGB to hex conversion.
Hex to RGB / HSL / CMYK
HEX
#ff5733RGB
rgb(255, 87, 51)HSL
hsl(11, 100%, 60%)CMYK
cmyk(0%, 66%, 80%, 0%)RGB to Hex
Hex
#ff5733Frequently Asked Questions about the Hex to RGB Converter
What is a hex color code?
A hex color code is a 6-digit base-16 number, written as #RRGGBB, where each 2-digit pair sets the red, green, or blue channel on a 0-255 scale. For example, #ff5733 means R 255, G 87, B 51, a vivid orange-red. The leading # is optional when you enter it here.
What does the 3-digit shorthand mean?
A 3-digit shorthand like #f53 is shorthand for the 6-digit form where each digit is doubled: #f53 expands to #ff5533. The shorthand is only valid when both digits in every channel are identical, so #1a2b3c cannot be shortened.
When should I use hex vs rgb()?
Hex is more compact and is the standard in HTML attributes, CSS stylesheets, and design tools like Figma. Use rgb() or rgba() when you need to set channels through CSS variables, blend with calc(), or add an alpha (opacity) value, since plain hex does not carry transparency.
Does this support an alpha channel?
No. The converter handles 3-digit and 6-digit opaque hex only (#RGB and #RRGGBB). 8-digit hex with alpha (#RRGGBBAA) and rgba() output are not supported. If you need transparency, set the alpha directly in your CSS with rgba() after converting the opaque channels here.
How is HSL calculated from hex?
The hex is parsed to integer RGB values (0-255), each channel is divided by 255 to get a 0-1 range, then the standard HSL formula derives lightness as (max + min) / 2, saturation from the channel range relative to lightness, and hue as an angle (0-360) based on which channel is dominant. All three output values are rounded to the nearest whole number.