Hex To RGB

Convert HEX colours to RGB, HSL and colour names

Convert HEX colour codes (#FF8800, #F80, #FF880080) into RGB/RGBA, modern CSS syntax and HSL, and see the nearest named CSS colour.
Try an example:

Output will appear here...

About Hex To RGB

How it works

  1. The HEX code is split into pairs of digits - red, green, blue and optionally alpha. Short codes like #F80 are expanded to #FF8800 first.
  2. Each pair is converted from hexadecimal to a number from 0-255.
  3. We also give the HSL (hue, saturation, lightness) form, the modern CSS rgb() syntax and the nearest of the 148 CSS colour names.

What you need

  • One or more HEX colour codes (3, 4, 6 or 8 digits, # optional), one per line.

Tips

  • HSL makes it easy to create lighter or darker shades: change only the last (lightness) number.

Runs in your browser. Everything happens in your browser - your code and data are never uploaded.

Frequently asked questions

What is the difference between RGB and HSL?+

RGB mixes red, green and blue light. HSL describes the same colour as hue (0-360° around the colour wheel), saturation and lightness, which is more intuitive for adjusting colours.