🎨 Color

HEX to RGB Converter

Convert HEX color codes to RGB and HSL values.

Results

RGB
rgb(47, 85, 212)
HSL
hsl(226, 66%, 51%)
CSS RGB (0–1)
0.1843, 0.3333, 0.8314

📊 HEX to RGB Converter chart

Visual summary of your results.

What is the HEX to RGB Converter?

Convert HEX color codes to RGB and HSL values. HEX and RGB describe the same colors in different notations, and many apps and code libraries accept only one of them.

HEX to RGB Converter – free online color tool illustration
HEX to RGB Converter — free, exact and private.

How to use the HEX to RGB Converter

  1. Enter your hex color.
  2. Results update automatically as you type; you can also press Calculate.
  3. Read the output: rgb, hsl, css rgb (0–1).
  4. Use the 📊 chart to see the result visually, then copy or share it.

Formula and method

R = hex[0..1], G = hex[2..3], B = hex[4..5] in base 16

Worked example

With hex color = #2f55d4, the HEX to RGB Converter returns rgb: rgb(47, 85, 212); hsl: hsl(226, 66%, 51%); css rgb (0–1): 0.1843, 0.3333, 0.8314.

Where the HEX to RGB Converter helps in real life

You copied #1E88E5 from a website and your design app asks for RGB values. Converting gives the exact red, green and blue numbers.

You are writing code that needs an RGBA value with transparency. Converting from HEX gives the base values to add an alpha channel.

Common mistakes to avoid

  • Leaving out the # or adding extra characters.
  • Using letters beyond F, which are not valid hex.
  • Confusing three-digit and six-digit HEX codes.
  • Forgetting that HEX codes may include transparency digits.

💡 Practical tip: Three-digit HEX like #0AF is shorthand for #00AAFF, so expand it before converting by hand.

Illustration: a design studio with color swatches and a tablet
HEX to RGB Converter in everyday work — illustration.

Tips for better results

  • Check the HEX code has three, six or eight hex digits.
  • Store both HEX and RGB values for brand colors.
  • Use HSL when you plan to adjust lightness.

Frequently asked questions

What does the HEX to RGB Converter do?

Convert HEX color codes to RGB and HSL values.

How is it calculated?

The HEX to RGB Converter uses this method: R = hex[0..1], G = hex[2..3], B = hex[4..5] in base 16.

Can you show an example?

With hex color = #2f55d4, the HEX to RGB Converter returns rgb: rgb(47, 85, 212); hsl: hsl(226, 66%, 51%); css rgb (0–1): 0.1843, 0.3333, 0.8314.

Is the HEX to RGB Converter accurate?

Yes. It uses standard formulas and exact constants, and the results are verified by our automated test suite. Values are displayed to up to 12 significant digits.

Is this tool free and private?

Yes — the HEX to RGB Converter is completely free with no sign-up, and it runs entirely in your browser, so the values you enter are never uploaded to our servers.

Related tools

📬 Get new tools first — free

Join Taurang to hear about new calculators, converters and features. No spam; unsubscribe anytime.

Create free account