HEX, RGB and HSL Color Converter
Convert between colour notations, with contrast ratios.
Everything is processed in this tab. Nothing you paste is sent anywhere.
Every tool runs entirely in your browser. Your files are never uploaded to a server.
HEX, RGB and HSL describe the same colours in different notations. HEX and RGB are the same numbers in different bases; HSL restates them as hue, saturation and lightness, which is far easier to adjust by hand.
How to use Color Converter
- Paste colours. One per line, in any of the three notations. Short hex like #fff works.
- Read all three notations. Each line is converted to HEX, RGB and HSL together.
- Check contrast. Give two colours and the WCAG ratio between them is shown.
About converting colour values
The three common notations describe the same sRGB colour space and differ only in how they present it. HEX and RGB are numerically identical — one is base sixteen and the other base ten — so converting between them is a formatting change rather than a calculation. HSL is a genuine transformation, restating the three channels as hue, saturation and lightness, and it earns its place by being adjustable. Producing a lighter variant of a brand colour is a single number in HSL and a guess in HEX, which is why design systems are usually specified that way. Contrast is where colour choices stop being aesthetic. The WCAG ratio is computed from relative luminance rather than from the raw channel values, weighting green far more heavily than blue because human vision does. That is why light grey text on white so often fails despite looking fine to the person who chose it, and why dark blue on black can fail even at what looks like a large difference. The thresholds — 4.5:1 for body text, 3:1 for large — are minimums rather than targets, and the formula has known limitations: it takes no account of font weight, and it is unkind to thin typefaces that clear it on paper and remain hard to read in practice.
Frequently asked questions
What is the difference between HEX and RGB?
Why use HSL?
What contrast ratio do I need?
Does a passing contrast ratio mean it is readable?
Last updated