Hex / RGB / HSL Converter

Convert colors between hex, RGB and HSL instantly. Free and private, right in your browser, with a live color swatch.

Paste a color in any format. Hex, rgb(), or hsl(), and get the other two instantly, with live sliders for hue, saturation, lightness, and alpha. Handy for grabbing a color from a design file and translating it into whatever format your CSS or design tool expects.

How to use it

  1. Paste a hex, rgb(), or hsl() value, or pick a color visually
  2. Adjust hue, saturation, lightness, or alpha with the sliders if needed
  3. Copy the converted value in whichever format you need

Frequently asked questions

What's the difference between HSL and RGB?
RGB defines a color by its red, green, and blue light levels (0-255 each), which is how screens actually render it. HSL describes the same color by hue (0-360° on a color wheel), saturation, and lightness, which is usually easier for humans to reason about when you want "the same color but darker" or "a bit more muted."
Does it support alpha/transparency values?
Yes. Enter or output an 8-digit hex (#RRGGBBAA), rgba(), or hsla() and the alpha channel carries through the conversion instead of getting dropped.
Why does my hex code look different after converting through HSL and back?
It shouldn't lose precision in normal use, but rounding can shift a value by 1 unit if you manually tweak the H/S/L sliders rather than pasting a hex directly. HSL uses percentages internally, so some hex values don't map to whole-number HSL percentages and back exactly.