Color converter — offline
HEX, RGB, HSL, and OKLCH — with a live swatch, entirely on your device.
| HEX | #2e8b57 | |
| RGB | rgb(46, 139, 87) | |
| HSL | hsl(146, 50%, 36%) | |
| OKLCH | oklch(56.9% 0.119 154.9) |
Convert HEX, RGB, HSL and OKLCH offline
Colour conversion is pure arithmetic, and there is no reason for it to involve a network request. Paste a colour in #hex, rgb(), or hsl() and every format appears at once alongside a live swatch, computed in your browser. Nothing about your palette is transmitted — the site has no backend, and a Content-Security-Policy blocks third-party requests, so an unreleased brand palette stays yours.
Input is forgiving: three-digit shorthand like #f80 works as well as the full six-digit form, and every output is CSS-ready to paste straight into a stylesheet.
When to use each format
- HEX — the universal interchange format. Compact, understood by every tool and every designer, and what brand guidelines are almost always written in.
- RGB — the same values in decimal. Useful when a colour is being computed in code, or when you need an alpha channel via
rgba(). - HSL — hue, saturation, lightness. Far more intuitive for building a palette by hand: keep the hue and vary the lightness to get a family of related shades.
- OKLCH — the modern, perceptually uniform space.
Why OKLCH is worth switching to
HSL has a well-known flaw: it is not perceptually uniform. Two colours with identical lightness values can look dramatically different in brightness — HSL yellow at 50% lightness appears far brighter than HSL blue at the same value. That is why palettes built by varying HSL lightness so often look uneven, and why adjusting saturation seems to shift the hue.
OKLCH is built so that equal numeric changes correspond to roughly equal perceived changes. Adjust lightness and the hue stays put; build a set of shades by stepping lightness and they look like a coherent family. It is supported in modern CSS and is the sensible default for new design systems.
Whatever space you work in, check the result: the WCAG contrast checker tells you whether a foreground and background pairing is actually readable, and also runs entirely on your device.
How to convert HEX, RGB and HSL colors offline
- 1
Paste a color in #hex, rgb(), or hsl().
- 2
See the swatch and every format at once.
- 3
Copy the CSS-ready value you need.
Color Converter — frequently asked questions
Do my brand colors get sent anywhere?
No — conversion is pure math in your browser. Nothing about your palette is transmitted.
Which formats can I convert between?
HEX (#2e8b57, #f80), rgb(), and hsl() as input; HEX, RGB, HSL, and modern OKLCH as output.
Why OKLCH?
OKLCH is the perceptually uniform color space modern CSS supports — adjust lightness or chroma without hue shifts. This tool gives you the CSS-ready value.