Color Code Converter

Your text never leaves your browser — everything runs on your device.

HEX
RGB
HSL
HSV

Click any format to copy it.

Convert a colour between HEX, RGB, HSL and HSV instantly, with a live preview swatch so you can see exactly what you are working with. Type a colour as #4f46e5, rgb(79, 70, 229) or hsl(244, 76%, 59%) and every format updates as you type. Click any format to copy it straight into your stylesheet. Free, no signup, and everything runs in your browser.

Frequently asked questions

What is the difference between HEX, RGB, HSL and HSV?

HEX and RGB describe a colour by its red, green and blue amounts — HEX is the compact #rrggbb form of RGB. HSL describes it by hue, saturation and lightness, which is easier to adjust by hand. HSV is similar but uses value (brightness) instead of lightness.

How do I use a converted colour in CSS?

Any of the formats works directly in CSS: color: #4f46e5; or color: rgb(79, 70, 229); or color: hsl(244, 76%, 59%); all give the same colour. Click a format on this page to copy it.

Can I enter a 3-digit HEX code?

Yes. A 3-digit code such as #fff is expanded automatically — each digit is doubled, so #fff becomes #ffffff (white).

Why do HSL values sometimes round to whole numbers?

HSL percentages and hue degrees are shown rounded for readability. The underlying conversion is exact, and converting back gives the same RGB colour within one unit.