How to convert colors
Pick a color or type a value in any box. HEX, RGB and HSL update together, so you can copy the format you need for CSS or design tools.
What is a colour converter?
The same colour can be written in several ways. Designers and developers switch between these formats all the time, depending on the tool or code they use. A colour converter changes a value from one format to another so the colour stays exactly the same.
Common colour formats
- HEX: six characters after a hash sign, such as #2457E6. Very common in web design.
- RGB: amounts of red, green and blue from 0 to 255, such as rgb(36, 87, 230).
- HSL: hue, saturation and lightness, which is easier to adjust by hand when you want a lighter or darker shade.
Where it helps
- Copying a brand colour from a design file into CSS.
- Creating lighter and darker variations of one colour.
- Matching colours between different software.
- Checking that a colour code is valid.
Tips for choosing a colour format
- Copy the HEX value for CSS and most design tools.
- Use RGB when you need to add transparency.
- Use HSL when you want to make a lighter or darker version of the same colour.
After converting, check that text written in the new colour is easy to read against its background. Dark text on a light background and the reverse usually work best.
Frequently asked questions
Why does a colour look different on another screen?
Screens have different brightness and colour settings. The code is identical, but the display may show it slightly differently.
Can I write HEX codes in short form?
Yes, three-character codes such as #FFF are shorthand for six-character codes like #FFFFFF when each pair repeats.
Is anything uploaded to a server?
No. The conversion happens in your browser.
Related tools: JSON Formatter, Base64 Encoder Decoder and Image Converter. See all free tools.
HEX, RGB and HSL: when to use each
- HEX is a six-character code such as #1D4ED8 and is the most common format in web design and CSS.
- RGB describes a colour by its red, green and blue values from 0 to 255. It is used in screens, apps and many design tools.
- HSL uses hue, saturation and lightness. It is the easiest format for making a colour lighter, darker or less vivid by changing one number.
Tips for working with colours
- To build a lighter or darker shade of your brand colour, convert it to HSL and change only the lightness value.
- Keep enough contrast between text and background so people can read it, especially on mobile screens.
- Short HEX codes such as #FFF are the same as #FFFFFF.
- Colours can look different on different screens, so check important designs on more than one device.
- Read our guide on HEX, RGB and HSL colors for more examples.
