How to Convert HEX to RGB
HEX and RGB describe the same sRGB color. Learn how #ff0000 becomes rgb(255, 0, 0), how short HEX expands, and how to convert in the browser.
HEX and RGB are the same color
#ff0000 and rgb(255, 0, 0) are both sRGB red. HEX writes each channel as two hexadecimal digits. RGB writes the same 0–255 integers in decimal. Converting does not change the color — it only changes the notation.
Design tools, CSS, and canvas APIs disagree about which spelling they want. Convert once, then copy the form you need.
How short HEX expands
#f00 is a 3-digit short form. Each digit is duplicated: f becomes ff, so #f00 is #ff0000. 4-digit and 8-digit HEX add an alpha channel. If you only need opaque CSS, copy the 6-digit form.
Convert HEX to RGB in your browser
You do not need a spreadsheet for everyday conversion.
- Open the Color Converter.
- Paste
#2563ebor2563ebinto HEX. - Copy
rgb(37, 99, 235)or the HSL form if you are about to rotate hue.
Going the other way
RGB to HEX is the inverse: each channel becomes two hex digits, lowercase in this tool. HSL is derived from the same RGB so HEX, RGB, and HSL cannot drift apart while you edit.
After you convert
If the color is for text, check it with the WCAG Contrast Checker. If you still need to pick by eye, use the Color Picker.
Frequently asked questions
- Is HEX to RGB lossless?
- For 6-digit HEX, yes: you get exact 0–255 channels. HSL display rounding uses one decimal and is derived from those integers.
- Does Toolshelf upload the color?
- No. Conversion runs in the browser.