Free HEX to RGB converter for CSS and HTML — how do I turn #RRGGBB into rgb() values for stylesheets?
Split the six hex digits into three pairs; each pair is one channel from 0–255. Example: #3498DB → R=0x34=52, G=0x98=152, B=0xDB=219 → rgb(52, 152, 219). Use our HEX to RGB page to type any #code and copy the result.
Detailed answer
Hexadecimal uses base 16, so two digits span 0–255 per channel. In CSS you can write #RGB shorthand when digits repeat (#abc = #aabbcc). Our dedicated converter parses your input, shows the same sRGB math the Color Picker uses, and includes a step-by-step breakdown under the calculator.
Relationship context
HEX and RGB describe the same sRGB color on screen; HEX is compact for palettes and APIs, while rgb() is explicit in CSS and design tokens.
Example sRGB codes (HEX · RGB · HSL)
More Color Picker tools
Open the main picker or a fixed input/output converter—same math as the hub, with copy-ready strings.