Skip to content

HEX, RGB & HSL colour converter

Convert colours between HEX, RGB and HSL with a preview, transparency and a copy button for each format.

AvailableIn your browserInput: Text

How to use: HEX, RGB & HSL colour converter

  1. Type a colour as HEX, rgb() or hsl() or use the picker.
  2. Check the preview.
  3. Copy the format you need.

What it accepts and what you get

Input
HEX colours (#rgb, #rrggbb, with alpha), rgb()/rgba() or hsl()/hsla().
Output
The same colour as HEX, RGB and HSL.
Where your data is processed
Your data is processed in your browser and is not sent to our servers.

Limitations and notes

  • HSL is rounded to whole numbers, so a round trip may differ by one unit.
  • To check whether two colours read well together use the contrast checker.

Frequently asked questions

How do I convert a HEX colour to RGB or HSL?

Enter the colour as HEX, rgb() or hsl() and you see the same colour in all three formats, ready to copy.

Why does the colour change by one unit after converting back and forth?

Because HSL is rounded to whole numbers, so converting from one format to another and back can vary by one unit.

When to use it

  • When a designer gives you a HEX and your CSS needs rgb() or hsl().
  • To make a lighter or darker variant by adjusting the HSL.

Examples

HEX to RGB
Type #ff8800 and get the same colour in rgb() and hsl().
With transparency
It accepts HEX with alpha and rgba()/hsla().

Common mistakes

  • Expecting an exact round trip: HSL is rounded to whole numbers and may differ by one unit.
  • Judging whether two colours read well together just by looking: use the contrast checker.