MultiConvers

HEX, RGB & HSL Color Converter

Convert a color between HEX, RGB and HSL. The fields stay in sync and a swatch shows the last valid color.

How to use

  1. Type a HEX value (#f00 or #ff0000), an RGB triple, or HSL values.
  2. The other fields update: HEX to RGB, RGB to HEX, HEX to HSL and RGB to HSL on the same page.
  3. Copy the format you need. The preview keeps the last valid color if a field is invalid.

How it works

HEX writes each sRGB channel as two hexadecimal digits (#RRGGBB). The short form #RGB expands each digit by doubling it (#f00 is #ff0000). RGB uses integers 0–255. HSL uses hue 0–360 and saturation/lightness 0–100.

Conversions use the common sRGB formulas: RGB is scaled to 0–1, lightness is the midpoint of min and max, saturation depends on that range, and hue comes from which channel is strongest.

Invalid input is flagged without wiping the last good color. Alpha is not converted here. Dedicated hex-to-rgb or rgb-to-hex URLs are not needed — every pair lives on this converter.

Formula

#RGB → #RRGGBB by doubling digits
RGB 0–255 ↔ HEX
HSL ↔ RGB via standard sRGB hue/chroma formulas

Worked examples

  • HEX to RGB and HSL

    #f00 #ff0000, rgb(255, 0, 0), hsl(0, 100%, 50%)

  • RGB to HEX and HSL

    rgb(0, 255, 0) #00ff00, hsl(120, 100%, 50%)

Useful notes

  • Grayscale colors use hue 0.
  • Values are not sent to a color API.

FAQ

Which HEX formats are accepted?

#RGB and #RRGGBB, with or without the leading #.

Can I convert HEX to RGB and back on this page?

Yes. HEX, RGB and HSL stay in sync. There is no separate hex-to-rgb or rgb-to-hex page.

Do you support transparency?

Not in this version. Only opaque HEX, RGB and HSL.

What happens if I type an invalid value?

That field shows an error. The preview keeps the last valid color.

Is the color sent to a server?

No. Conversion is local math in your browser.

Related tools

See all Utilities tools.