Convert colour codes: every format at once
Enter a colour in any notation, be it HEX, RGB, HSL, HSV, OKLCH or a CSS name, and get all the other formats at the same time, each row copyable on its own. Plus complementary, triad and analogous colours and five tints and five shades. Everything is calculated in your browser; nothing is uploaded.
Which colour format for which job?
| Format | Typical use | Strength |
|---|---|---|
| HEX | CSS, design files, tickets | short, understood everywhere |
| RGB / RGBA | canvas, SVG, opacity | think directly in channels |
| HSL | quick lightening in an editor | hue and lightness separated |
| HSV / HSB | colour pickers in graphics apps | matches the feel of the sliders |
| OKLCH | design systems, colour scales | perceptually even steps |
| CMYK | pre-alignment with your printer | approximation for print |
The 148 CSS colour names are convenient but coarse. The converter therefore shows the exact name when one exists and the closest one otherwise, measured in OKLab, because a plain RGB distance does not match what the eye considers similar.
What is OKLCH and why bother?
OKLCH is the polar form of OKLab, a colour space published by Björn Ottosson in 2020 (bottosson.github.io/posts/oklab). Its promise: equal numeric steps look equally large. HSL cannot do that: hsl(60 100% 50%) (yellow) and hsl(240 100% 50%) (blue) carry the same lightness number yet look nothing alike in brightness.
In practice that means a 50-to-900 scale built on OKLCH lightness looks even in every hue. In HSL you have to hand-tune each hue.
oklch() is part of CSS Color Module Level 4. According to MDN's browser compatibility data the function has been usable in every major engine since May 2023: Safari 15.4 shipped it in 2022, Chrome 111 and Firefox 113 followed in 2023 (MDN: oklch()).
How are the harmonies built?
From the HSL colour wheel: complementary rotates the hue by 180 degrees, the triad by 120 and 240 degrees, analogous by minus and plus 30 degrees. Saturation and lightness stay untouched. That is classic colour theory and a solid starting point, not a replacement for a human eye.
What are tints and shades for?
They turn one brand colour into a whole palette: lighter tones for surfaces and hover states, darker ones for text and borders. The mix runs linearly towards white or black in five even steps. Clicking a swatch loads that colour into the input field, so you immediately see every format for it.
Where are the limits?
- CMYK is an approximation. The simple formula knows neither paper nor colour profile. For real print output, your printer's ICC profile is what counts.
- OKLCH can describe more colours than an sRGB screen shows. If your input sits outside the gamut, the tool clips it to the closest displayable colour and tells you.
- The eyedropper depends on the browser. The EyeDropper API exists in Chromium-based browsers; in Firefox and Safari we hide the button rather than show a dead control.
- Semi-transparent colours are emitted as eight-digit HEX. How they actually look depends on what is behind them.
Are my colours readable too?
Pretty is not automatically legible. To find out whether a text-and-background pair meets the WCAG requirements, use the contrast checker. It shows the ratio, the AA/AAA verdict and the closest colour that passes.