Skip to main content

Color Converter

Convert HEX, RGB and HSL color codes instantly, with a live preview.

Preview
Palette (click to copy)

The same colour, two ways of thinking

The orange used on this site, converted to RGB and HSL.

Input
#e76f51
Output
rgb   231, 111, 81
hsl   12, 76%, 61%

RGB says how much of each primary to emit; HSL says what the colour is — hue 12° is an orange-red. Change one HSL number and you stay in the same family; change one RGB number and you can land anywhere.

Online color converter

Web design constantly switches between color notations: a mockup gives you HEX, CSS wants HSL to tweak lightness, or code needs RGB values. This color converter converts HEX, RGB and HSL in real time with a live preview — change one and the other two update instantly.

How to use

  1. Enter a color in any field (HEX, RGB or HSL).
  2. The other two formats and the preview update instantly.
  3. Copy the format you need into your CSS or design tool.

Common use cases

  • Turn a mockup's HEX into the HSL you want in CSS.
  • Use HSL to fine-tune light/dark variants of one hue.
  • Get RGB values for use in code.

Reach for HSL to tweak brightness — and mind the alpha

Working between CSS and design tools, you constantly need the same color in HEX, RGB, and HSL — the mockup hands you a HEX value, but your CSS wants rgba, or you need HSL to nudge the hue. Two practical tips. To lighten or darken a color, HSL is the intuitive choice: leave hue and saturation alone and just move the L (lightness) to get a tidy set of shades from one base color, which beats guessing at HEX digits. And don't forget transparency: an 8-digit HEX tacks two alpha characters onto the end, while rgba adds a separate 0–1 value — the two formats express it differently, so watch that you don't drop it in the conversion.

Why does dragging the hue slider on a grey do nothing?

The output of this page answers it directly. White #ffffff is 0, 0%, 100%, black is 0, 0%, 0% and mid grey #808080 is 0, 0%, 50% — all three report hue 0, but that 0 is not "red": it is undefined and reported as zero, because saturation is 0%. Compare pure red at 0, 100%, 50%: same hue number, completely different meaning. While saturation stays at zero, no amount of hue will tint anything.

Frequently Asked Questions

What is the difference between HEX, RGB and HSL?

HEX is the hexadecimal web code (#RRGGBB); RGB uses red/green/blue 0–255; HSL uses hue, saturation and lightness, which is more intuitive for tweaking a shade. All three interconvert.

Does it support transparency (alpha)?

This tool focuses on the three base representations HEX/RGB/HSL; you can add an alpha value on top for RGBA/HSLA as needed.

Is the conversion accurate?

Yes. It uses standard color formulas. HEX and RGB map exactly; HSL may round very slightly, imperceptibly to the eye.

Related reading

HEX, RGB and HSL: A Practical Guide to CSS Color Formats →

Embed this tool

Add this tool to your own website or blog for free — just copy and paste the code below (it includes a link back to this site).