HEX to RGB

Enter a three- or six-digit hex value and get the red, green and blue channels immediately, with alpha support when the hex includes it.

Loading this tool…

Nothing you enter here is sent anywhere. There is no file and no request to our server - the work is done in your browser and disappears when you close the page.

How It Works

  1. Enter — Fill in the values the tool asks for.
  2. Run — Press the button; an empty field is reported by name rather than read as zero.
  3. Read — The answer comes with the working behind it, so you can check the figure.
  4. Take it — Copy the result, or download it where the tool offers that.

Frequently Asked Questions

Are the conversions mathematically exact?
RGB to HSL and back use the standard CSS formulas. Rounding is applied to display values, so an HSL you tweak by hand can land one unit away from the original hex.
What about colours outside sRGB?
Only sRGB values are handled. Display-P3 and wide-gamut colours are treated as their sRGB numbers with no colour-space conversion.