Color Converter

Convert colors between HEX, RGB, and HSL instantly, in both directions, with copy-ready values.

Convert any color between HEX, RGB, and HSL. Edit whichever format you have; the others update live and copy with one click.

#4f46e5
or pick visually
HEX
RGB
HSL
How it works

All three fields describe the same color: HEX is the compact web notation, RGB spells out the red/green/blue channels (0-255 each), and HSL re-expresses the color as hue, saturation, and lightness. Edit any one and the tool recomputes the other two instantly; the swatch and the system color picker stay in sync too.

Everything runs locally in your browser; nothing is uploaded and there is no signup. You can also deep-link a color with ?color= plus the hex code.

Frequently asked questions

How do I convert HEX to RGB?

Type or paste the hex code (with or without the #, 3- or 6-digit) into the HEX field and the RGB and HSL values update instantly. It works in every direction: edit whichever field you have, and the other two follow.

How do I convert RGB to HEX?

Enter the red, green, and blue values in the RGB field. You can paste a full rgb(37, 99, 235), or just type 37, 99, 235; both are understood. The HEX field shows the result, ready to copy.

What is HSL and when is it useful?

HSL describes a color by hue (0-360 on the color wheel), saturation, and lightness. It is the easiest format to adjust by hand: keep the hue, lower the lightness for a darker shade, or lower the saturation for a more muted tone. CSS supports it natively.

Which input formats are accepted?

HEX: #1a2b3c, 1a2b3c, or shorthand #abc. RGB: rgb(26, 43, 60) or bare comma/space-separated numbers 0-255. HSL: hsl(210, 40%, 17%) or bare numbers, with the % signs optional.

Why do RGB values sometimes shift by one when converting through HSL?

HSL values are shown rounded to whole numbers, so converting an exact RGB color to rounded HSL and back can land one step away. The HEX and RGB fields always stay exact with each other; treat HSL as the human-friendly view.

Can I build a palette from my color?

Yes. The Create a palette from this color button opens our Color Palette Generator seeded with your current color, giving you analogous, complementary, triadic, and monochromatic palettes in one click.

Is anything uploaded?

No. The conversion is pure math running in your browser; nothing is sent to a server and there is no signup.