Technical and design
Color Converter: HEX, RGB, HSL and OKLCH
Convert colors between HEX, RGB, HSL and OKLCH, one or many at a time, in CSS syntax.
Runs in your browser; nothing is uploaded. · Free, no account · 1 min
Any CSS colour: HEX, rgb(), hsl(), oklch(), oklab(), lab(), a colour name.
Importing a saved run into your account is coming soon. Until then, your last runs stay in this browser only, and you can download your files.
How to use
- Type or paste one color per line, as HEX, rgb(), hsl(), oklch() or a color name.
- Choose the format to copy, and whether to write CSS custom properties.
- Read the table of every format for each color, and the warning for any color outside sRGB.
- Copy the converted values into your stylesheet.
What it checks and how it works
The tool parses each color with culori and writes HEX, RGB, HSL and OKLCH in the space-separated syntax of CSS Color Module Level 4, with a slash and the alpha value when a color is translucent. OKLCH is the polar form of Oklab, the perceptual color space described by Björn Ottosson, who designed it to predict perceived lightness, chroma and hue better than older spaces such as HSL.
A color written in OKLCH can fall outside the sRGB gamut that HEX, RGB and HSL describe. Such a color is brought inside by lowering its chroma while keeping its lightness and hue, using culori's clampChroma, and the table marks it as mapped. That is culori's method and not the exact algorithm in CSS Color 4. Values are rounded, so converting back and forth can change the last digit.
Sources
- W3C: CSS Color Module Level 4 opened 29 Oct 2026
- Björn Ottosson: A perceptual color space for image processing (Oklab) opened 29 Oct 2026
Related tools
WCAG Contrast Checker
Check whether a text and background color pair meets the WCAG 2.2 contrast requirements, and see the exact ratio.
Favicon and Web App Manifest Generator
Turn one logo into a favicon set, a maskable icon, an Apple touch icon, a web manifest and the head tags that link them.
Image to WebP and AVIF Converter
Convert images to WebP or AVIF in your browser, set the quality, and see how much each file shrinks.
Questions
About this tool
HEX covers sRGB only. If the OKLCH color lies outside sRGB, its chroma is lowered to fit and the tool marks it as mapped.
The space-separated form from CSS Color Module Level 4, for example rgb(11 95 255), with a slash and the alpha value when the color is translucent.
Yes. Put one color on each line and the table lists every format for each, which you can copy as plain values or as CSS custom properties.
Get started today
Find out where your brand stands in AI. Free.
Run a free AI visibility analysis on your domain. No credit card, results in minutes. See what AI engines say about your brand today.
Brands already measuring their AI visibility with Zaher.


