SEOLyzerPro
Use 47 free online tools: meta tag and robots.txt generators, image and text tools, JSON converters, calculators and unit converters. No signup needed
Color Converter
Convert one color into HEX, RGB, HSL, HWB and CMYK
Color Converter
What this tool does
The Color Converter changes a colour from one format to another. Enter a colour in one notation, such as the hex code #FF5733, and the tool shows the same colour as RGB, HSL and other formats. Web designers, developers, artists, bloggers and anyone who works with brand colours use it to move colours between design programs, style sheets and print files. [List the formats your tool supports, for example HEX, RGB, HSL, HSV and CMYK.]
How to use it
- Enter a colour value in any supported format, or pick a colour if your tool has a colour picker.
- Click Convert.
- Read the equivalent values in the other formats.
- Copy the one that you need. Use Reset to start again.
The common formats
HEX is a six-digit code that starts with #. It is made of three pairs: red, green and blue. Each pair is a hexadecimal number from 00 (none) to FF (full, 255).
RGB gives red, green and blue as numbers from 0 to 255, as in rgb(255, 87, 51). This is how screens mix light.
HSL describes a colour by hue (the colour’s position on a 360-degree wheel), saturation (how vivid it is) and lightness (how light or dark), as in hsl(11, 100%, 60%). It is easy for people to adjust.
HSV or HSB is similar to HSL but uses value or brightness instead of lightness. Many design programs show it in their colour pickers.
CMYK is used in printing. It gives the amounts of cyan, magenta, yellow and black ink.
A worked example
Start with the hex code #FF5733.
- HEX to RGB. Split into FF, 57 and 33. FF is 255. 57 in hexadecimal is 5 × 16 + 7 = 87. 33 is 3 × 16 + 3 = 51. The result is rgb(255, 87, 51).
- RGB to HSL. Divide each value by 255 to get 1, 0.341 and 0.2. The largest is 1 and the smallest is 0.2. Lightness is (1 + 0.2) ÷ 2 = 0.6, which is 60%. The difference is 0.8, so saturation is 0.8 ÷ (1 − |2 × 0.6 − 1|) = 0.8 ÷ 0.8 = 100%. The hue is 60 × (0.341 − 0.2) ÷ 0.8 ≈ 10.6, which rounds to 11 degrees. The result is hsl(11, 100%, 60%).
- RGB to CMYK. Black is 1 − 1 = 0. Magenta is 1 − 0.341 ≈ 66%. Yellow is 1 − 0.2 = 80%. Cyan is 0. The result is cmyk(0%, 66%, 80%, 0%).
A second example: #1E90FF is rgb(30, 144, 255) and hsl(210, 100%, 56%).
Basic colours for reference
| Colour | HEX | RGB | HSL |
|---|---|---|---|
| Red | #FF0000 |
255, 0, 0 | 0, 100%, 50% |
| Yellow | #FFFF00 |
255, 255, 0 | 60, 100%, 50% |
| Green | #00FF00 |
0, 255, 0 | 120, 100%, 50% |
| Blue | #0000FF |
0, 0, 255 | 240, 100%, 50% |
| White | #FFFFFF |
255, 255, 255 | 0, 0%, 100% |
| Grey | #808080 |
128, 128, 128 | 0, 0%, 50% |
| Black | #000000 |
0, 0, 0 | 0, 0%, 0% |
Going the other way
RGB to HEX. Divide each number by 16. The whole part is the first digit, and the remainder is the second digit. For 87, 87 ÷ 16 is 5 with a remainder of 7, so the pair is 57. For 255, the pair is FF, and for 51, it is 33. In hexadecimal, the digits above 9 are A (10), B (11), C (12), D (13), E (14) and F (15).
HSL to RGB. For hsl(120, 50%, 50%), the colour is a medium green. The calculation gives rgb(64, 191, 64), which is the hex code #40BF40.
Short hex codes and transparency
A three-digit hex code is a shortcut for a six-digit code in which each digit is doubled. So #F00 means #FF0000, and #3CF means #33CCFF. A hex code with eight digits adds two digits for alpha, the opacity. For example, #FF573380 is the same orange-red at about 50% opacity, because hex 80 is 128, and 128 ÷ 255 ≈ 0.5. In CSS, this can also be written rgba(255, 87, 51, 0.5).
Why HSL is useful for designers
HSL makes it simple to create variations of one colour. Keep the hue and saturation, and change the lightness: hsl(11, 100%, 80%) is a lighter tint of the example colour, and hsl(11, 100%, 40%) is a darker shade. Hex and RGB values do not show this relationship clearly. Many designers use HSL to build a consistent palette with hover states, backgrounds and borders.
RGB and CMYK are not the same kind of colour
RGB is an additive system. Screens start with black and add red, green and blue light to make other colours. CMYK is subtractive. Printing starts with white paper and adds ink that absorbs light. Because of this, some bright screen colours, especially vivid blues and greens, cannot be printed exactly. A simple formula converts RGB to CMYK, and that is what a basic online tool does. Real print results depend on the printer, the paper and the colour profile, so the numbers are a starting point. For professional printing, ask the printer for their profile and use a design program with colour management.
Colour and accessibility
When you pick colours for text and backgrounds, readability matters. The Web Content Accessibility Guidelines (WCAG) ask for a contrast ratio of at least 4.5 to 1 for normal text and 3 to 1 for large text. Light grey text on white often fails this. Do not use colour as the only way to give information, because some people cannot tell certain colours apart. Check your colour pairs with a contrast checker after you choose them.
Tips for good results
- Always write a hex code with the # sign and with six digits, to avoid confusion.
- Round only at the end. Small rounding differences between tools, such as 10.6 or 11 degrees for hue, are normal.
- Save your brand colours in one list with all formats, so that your website, social posts and print files match.
- Check the colour on more than one screen, because displays differ.
- Use the same colour space across your tools. Most web colours are in sRGB.
Privacy
“The conversion happens in your browser and the values you enter are not sent to our server.”
Limits of this tool
The converter applies standard formulas. It does not manage colour profiles, and its CMYK values are an approximation that is not exact for professional printing. Results may differ slightly from other tools because of rounding. It cannot judge whether a colour is suitable for your design or accessible for your readers.
Frequently asked questions
What does the hex code #FFFFFF mean?
White, with red, green and blue all at 255.
How do I convert HEX to RGB by hand?
Split the code into three pairs, then convert each pair from hexadecimal to a number from 0 to 255.
Why does my printed colour look different?
Screens use light and printers use ink, and each device shows colour a little differently.
What is the difference between HSL and HSV?
HSL uses lightness, where white is at the top. HSV uses brightness, where the pure colour is at the top.
Can I use hex codes with transparency?
Yes, an eight-digit code adds alpha for opacity.
Related tools
Image Converter, Image Resizer, Open Graph Generator, Twitter Card Generator, Meta Tag Generator and Base64 Encode.