🎨 HEX to RGB Converter

Convert hex color codes to RGB and HSL. Also converts RGB back to hex.

Enter a hex code and click Convert.


Reverse: RGB to HEX

About the HEX to RGB Converter

This converter takes a hexadecimal color code (e.g. #0EA5E9) and instantly produces the equivalent RGB, RGB percentage, HSL, and HSV values. It also lets you reverse the conversion: enter R/G/B values and get the hex code back. All math happens locally in your browser.

Color formats explained

  • HEX — Six hexadecimal digits prefixed with #, two for each of red, green, blue (e.g. #0EA5E9).
  • RGB — Three decimal integers from 0 to 255 (e.g. rgb(14, 165, 233)).
  • RGB percentage — Each channel as a percentage of 255 (e.g. 5.5%, 64.7%, 91.4%).
  • HSL — Hue (0–360°), Saturation and Lightness (0–100%). Intuitive for designers.
  • HSV — Hue, Saturation, Value. Used by image editors like Photoshop.

Frequently asked questions

Does the hex code need the # prefix? The converter accepts both #RRGGBB and RRGGBB. Three-digit shorthand #RGB is also supported.

Are alpha channels supported? This tool focuses on RGB / HSL. Eight-digit hex codes (with alpha) are not currently parsed.

Are the conversions exact? Yes. Standard formulas are used and results are rounded to integers where appropriate.