Hex to RGB Converter Free

Convert hex colour codes to RGB and HSL, and back again, with a live preview.

rgb(220, 255, 79)
RGB
hsl(72, 100%, 65%)
HSL
220 · 255 · 79
RGB values

How to use this tool

  1. 1Enter a hex code, or pick a colour with the picker.
  2. 2Read the RGB and HSL equivalents.
  3. 3Adjust the alpha value if you need RGBA.
  4. 4Copy the format your code needs.

About this tool

The same colour gets written several ways depending on where it lives. Design handoffs and brand guidelines use hex. CSS needs RGB or RGBA the moment transparency is involved. HSL is what you actually want when adjusting a colour by hand, because changing lightness while holding hue and saturation produces a coherent tint or shade rather than a muddy guess. Converting between them by hand means base-16 arithmetic nobody enjoys. This converter shows all three formats side by side with a live swatch, so you can confirm you are looking at the colour you expected before pasting it into a stylesheet. Add an alpha channel for overlays and shadows, and copy in exactly the syntax your code expects.

Frequently Asked Questions

What does the hex code actually mean?

+

Each pair of characters is one colour channel in base 16: red, green and blue, from 00 to FF.

Do three-character hex codes work?

+

Yes. Shorthand like #f0c expands by doubling each character, giving #ff00cc.

When should I use HSL?

+

When you are adjusting a colour rather than specifying one. Changing lightness in HSL keeps the hue consistent.

Related Tools