
Free Online Color Converter
Convert any colour between HEX, RGB, HSL, HSV and CMYK, pick it visually and check text contrast with the WCAG ratio, all in your browser.
Designers and developers describe the same colour in many ways. A style sheet may use a hexadecimal code, a graphics program may show red, green and blue numbers, a brand guide may give hue, saturation and lightness, and a printer may ask for percentages of its four process inks. This converter shows all of them at once from any one input, and it also tells you whether white or black text will be readable on top of the colour.
The formats at a glance
| Format | Example for our violet | What it describes |
|---|---|---|
| HEX | #5A28C8 | Red, green and blue in base 16 |
| RGB | rgb(90 40 200) | Amounts of red, green and blue, 0 to 255 |
| HSL | hsl(258.8 66.7% 47.1%) | Hue angle, saturation, lightness |
| HSV | hsv(258.8, 80%, 78.4%) | Hue, saturation, brightness value |
| CMYK | cmyk(55%, 80%, 0%, 21.6%) | Ink amounts, a simple screen estimate |
How to use it
- Type a colour in any supported form, or use the colour picker.
- Read every format in the list and copy the one you need.
- Look at the large swatch, which shows the colour and its code.
- Check the contrast boxes to see how white and black text would perform.
Supported inputs include three, four, six and eight digit HEX codes, rgb and rgba with commas or spaces and percentages, hsl and hsla with an optional slash for transparency, and a short list of common colour names.
A worked example
The colour #5A28C8 has red 90, green 40 and blue 200. Its hue is about 258.8 degrees, which lies in the violet part of the wheel. Saturation is 66.7 percent and lightness 47.1 percent in HSL, while the HSV brightness is 78.4 percent. The simple CMYK estimate is 55, 80, 0 and 21.6 percent. White text on this colour has a contrast ratio of about 8.16 to 1, and black text about 2.57 to 1, so white is the clear choice for readable text.
Understanding contrast
The Web Content Accessibility Guidelines measure contrast as a ratio from 1 to 21, comparing the brightness of two colours. Black on white is 21 to 1. A ratio of at least 4.5 to 1 is the usual target for normal text at the AA level, 3 to 1 is accepted for large text, and 7 to 1 reaches the stricter AAA level. The converter labels each result. In our palette, for instance, the blue #4A6EDD gives about 4.60 with white text, while the cyan #46D3DC gives only about 1.81 with white but 11.61 with black. A colour that looks bold can still be a poor background for light text.
About rounding and accuracy
Conversions between RGB, HSL and HSV use the standard formulas. Values are shown to one decimal place, so converting a rounded result back may differ from the start by a step. For web work, the HEX or RGB code is the exact value; HSL and HSV are convenient ways of thinking. We checked the conversions against an independent reference on 1,500 random colours, and the results agreed to within floating-point precision.
Why CMYK is only an estimate
Screens mix light, while printers mix ink, and real print colours depend on the paper, the ink and the profile used by the printer. The CMYK numbers here come from a simple formula that is useful for rough comparisons and quick drafts. For work that will be printed, ask your printer for their profile and use professional software to convert, because the printed colour can differ from the screen.
Tips for choosing colours
- Pick text and background together, and test the contrast before you commit.
- Do not rely on colour alone to carry meaning; add words or icons.
- Keep a small set of brand colours and record their HEX codes.
- Use HSL when you want a lighter or darker version: change the lightness only.
- Check colours on a phone, outdoors and in dark mode.
Limits
This tool works in the sRGB colour space used on the web. It does not handle wide-gamut colours, colour management profiles or colour-blindness simulation. Transparency is kept in the HEX and RGB output when you supply it, but contrast is measured on the solid colour. If you type something that is not a colour, you will see a message, and nothing is evaluated as code.
Build a full set with the colour palette generator, blend colours with the CSS gradient generator, and try them in the playground. The guide to choosing brand colours and fonts explains how to decide, and the graphic design course covers colour theory.
Key takeaways
- One input gives HEX, RGB, HSL, HSV and CMYK together.
- Contrast of 4.5 to 1 is the usual target for normal text.
- HEX and RGB are exact; HSL and HSV are rounded for display.
- CMYK here is a screen estimate, not a print profile.
- Everything is calculated on your device.
Questions
How do I convert HEX to RGB?
Split the six digits into three pairs and read each as a base 16 number. For #5A28C8, 5A is 90, 28 is 40 and C8 is 200, so the colour is rgb(90, 40, 200). The converter does this for you and shows HSL, HSV and CMYK at the same time, so you can copy whichever form you need.
What is the difference between HSL and HSV?
Both describe a colour by hue, saturation and a third value. In HSL the third value is lightness, where 50 percent is the pure colour and 100 percent is white. In HSV the third value is brightness, where 100 percent is the brightest version. They give different numbers for the same colour, so do not mix them up.
What contrast ratio do I need?
For normal-sized text, aim for at least 4.5 to 1, which is the WCAG AA level. Large text needs 3 to 1, and the stricter AAA level asks for 7 to 1. Black on white gives 21 to 1. Use the contrast boxes to check white and black text on your colour before using it.
Can I use the CMYK values for printing?
Only as a rough guide. The numbers come from a simple formula for screens, while real printing depends on paper, ink and the printer profile, so printed colours can look different. For printed work, ask the printer for their requirements and convert in professional software that uses the correct profile.
Does the tool support transparency?
Yes, for input and for the HEX and RGB output. You can type an eight digit HEX code, rgba, or a slash alpha in rgb and hsl. The preview shows the transparency over a checkerboard. Contrast ratios are measured on the solid colour and ignore transparency.
