HEX, RGB and HSL Colour Converter
Convert a colour code between HEX, RGB and HSL instantly, with a live preview before you copy it into your design.
- Free, no sign-up
- Runs in your browser
- الصور والويب
#4F46E5rgb(79, 70, 229)hsl(243, 75%, 59%)Accepts short and long HEX, and converts between HEX, RGB and HSL instantly.
Three formats, one colour
On the web the same colour can be written three ways. HEX is a short hexadecimal form such as #4F46E5, the most common in CSS. RGB states red, green and blue from 0 to 255. HSL describes the colour by hue, saturation and lightness, which is easiest to adjust by hand: raise or lower lightness and you get a lighter or darker version of the same colour.
When do you need a conversion?
- A designer gave you RGB and your CSS file expects HEX.
- You want to adjust a colour by changing only its lightness, which is simpler in HSL.
- You need the same colour in a design tool that supports only one format.
How to use it
Type the code into the field, short or long form, with or without the # sign. All three formats appear instantly with a preview swatch. Copy the one your project needs.
Small details that matter
The short form #fff means exactly #ffffff, not a different colour. Transparency is written in CSS with a fourth channel and does not appear in classic HEX formats. And if you are building a brand identity, store the core colours with their codes in one place instead of copying them from scattered files.
Frequently asked questions
Does it support the short form?
Yes, and it expands it to the full form automatically with the correct RGB and HSL values.
Does it handle transparency?
No, because basic HEX formats carry no alpha channel. Use rgba() or hsla() when you need it.
Is the conversion exact?
Yes within the 8-bit range displays use, though you may see rounding differences when converting between formats with different precision.