About this tool

This color converter translates any color between HEX, RGB and HSL, updates all three formats together and shows a live preview swatch.

How to use it

  1. Enter a HEX code, an RGB value or an HSL value, or choose a color with the picker.
  2. Watch the other two formats and the preview update automatically.
  3. Use Random Color for inspiration, then Copy HEX or Copy RGB.

Good to know

  • HEX is a base-16 notation for RGB: #RRGGBB, where each pair is 00–FF (0–255 in decimal).
  • 3-digit shorthand such as #0af expands to #00aaff.
  • HSL describes a color as hue (0–360°), saturation (0–100%) and lightness (0–100%).
  • HEX, RGB and HSL describe the same sRGB colors, so converting between them does not change the color.

Runs entirely in your browser — nothing you enter is uploaded or stored.

Frequently asked questions

How do I convert HEX to RGB?

Split the six digits into three pairs and convert each pair from hexadecimal to decimal. For example #1DB954 is rgb(29, 185, 84).

When should I use HSL instead of HEX?

HSL makes it easy to create lighter, darker or less saturated variants of a color by changing one number, which is handy for design systems.

Does converting lose any color accuracy?

HSL values are rounded to whole numbers here, so round-tripping can shift a channel by one step; the visible difference is negligible.

Is anything sent to a server?

No. All conversions happen in your browser.