From hex code to RGB
Paste a HEX code — with or without the #, in 3, 4, 6 or 8 digits — and the converter shows the RGB value ready for CSS, along with the separate red, green and blue numbers. Short codes are expanded automatically (#38f is #3388ff), and 8-digit codes include alpha as rgba().
You'll also see HSL, OKLCH, HSV, CMYK and decimal versions of the color, a live swatch, and how readable white and black text would be on it.
How to convert HEX to RGB
- 1
Paste the HEX code
3, 4, 6 or 8 digits, # optional.
- 2
Read the RGB value
Shown as rgb() plus separate channel values.
- 3
Copy
Copy RGB or any other format.
Key features
All HEX lengths
#rgb, #rgba, #rrggbb and #rrggbbaa.
RGBA for transparency
Alpha is converted to a 0–1 value.
Other formats too
HSL, OKLCH, HSV, CMYK and decimal.
Accessible choices
WCAG contrast for white and black text.
Common uses
- CSS work: Convert a HEX brand color to rgba() for a transparent overlay.
- Game and app development: Get 0–255 values for engines that need RGB.
- Office and design apps: Enter exact RGB values in Word, PowerPoint or Canva.
Tips and good to know
- Need the reverse? Use the RGB to HEX Converter.
- To convert between all formats at once, open the Color Code Converter.
