Converter Tools
OKLCH Color Converter
Convert any color to and from OKLCH and OKLab. Paste HEX, RGB, HSL, HWB, or named colors and get OKLCH plus every CSS Color 4 format with a live preview.
Detected source: hex
Preview
- L
- 0.623
- C
- 0.188
- H
- 259.8
Nearest CSS named color: turquoise
OKLCH adjustments
Drag to perceptually nudge lightness, chroma, or hue. Output and preview update in real time. Reset to clear overrides.
0 = black, 1 = white
0 = gray, 0.4 = max sRGB-ish chroma
0-360 degrees around the color wheel
All formats
Every common CSS color representation. Click any value to copy.
OKLCH (CSS Color 4)
oklch(0.623 0.188 259.81)
Modern perceptual color in oklch(L C H / a). The format Tailwind v4 ships with.
OKLCH (percent L)
oklch(62.3% 0.188 259.81)
Same value with lightness as a percentage (CSS allows both).
OKLab (CSS Color 4)
oklab(0.623 -0.033 -0.185)
Cartesian form of OKLab with the same perceptual properties as OKLCH.
HEX
#3b82f6
Six-digit sRGB form. Most universally accepted.
rgb()
rgb(59 130 246)
Modern CSS Color 4 syntax with optional / alpha.
rgb()/rgba() legacy
rgb(59, 130, 246)
Comma-separated form supported by every browser ever shipped.
hsl()
hsl(217.2deg 91.2% 59.8%)
hwb()
hwb(217.2deg 23.1% 3.5%)
CSS custom property
:root {
--color: oklch(0.623 0.188 259.81);
--color-hex: #3b82f6;
}Tailwind arbitrary class
bg-[oklch(0.623_0.188_259.81)]
Use as a background utility on a Tailwind class. Swap bg- for text-, border-, or any other utility prefix.
How to use
- Paste any color value into the Color value input. HEX (with or without #), rgb()/rgba(), hsl()/hsla(), hwb(), oklch(), oklab(), and named CSS colors are all auto-detected.
- Read the Preview swatch and the L, C, H readout to see the perceptual coordinates, plus the nearest CSS named color when one is close.
- Drag the Lightness, Chroma, or Hue sliders to nudge the color in OKLCH space. The preview, every output row, and the CSS variable update in real time. Use Reset adjustments to return to the parsed value.
- Browse the All formats panel and click Copy on any row to grab that exact representation, or click Copy all to copy a multi-line block of every format at once.
- Use the CSS custom property panel to drop the color straight into a :root rule, or copy the Tailwind arbitrary-value class for use as bg-[oklch(...)] / text-[oklch(...)] / border-[oklch(...)].
About this tool
OKLCH Color Converter takes any CSS color you paste and gives you the equivalent OKLCH and OKLab values plus every classic format (HEX, rgb(), hsl(), hwb()) at the same time, with a live swatch and adjustable Lightness, Chroma, and Hue sliders that update the entire output in real time. OKLCH (Lightness, Chroma, Hue) is the perceptually uniform polar form of OKLab introduced in CSS Color Module Level 4 and adopted by Tailwind v4 as the default color space, because the same numeric step in lightness or chroma feels like the same visual step regardless of the hue (unlike HSL, where blues at 50% lightness look much darker than yellows at the same value). The parser auto-detects the input format: 3, 4, 6, or 8 digit HEX with or without a leading hash, modern Color 4 rgb()/hsl()/hwb() with space-separated values and / for alpha, the legacy comma-separated rgba()/hsla() forms, hwb(), oklch(), oklab(), and named CSS colors like tomato or rebeccapurple. Conversion math follows the published Color Module Level 4 reference matrices for linear sRGB to OKLab plus the standard sRGB transfer function, so values round-trip cleanly to within rounding error and match what the browser renders natively. When an OKLCH input falls outside the sRGB gamut (which is common for vivid greens and deep blues at high chroma) the tool clearly marks the preview as a clamped sRGB approximation while keeping the original OKLCH coordinates in the output, so you can copy the wide-gamut spec value into a stylesheet and let CSS handle the gamut mapping at render time. Output rows include OKLCH with unitless lightness, OKLCH with percentage lightness, OKLab in Cartesian form, the closest sRGB HEX (with optional 8-digit alpha when the input has transparency), modern Color 4 rgb(), legacy comma-separated rgba(), hsl() with degree-based hue, and hwb(). A precision control sets the number of decimals from 1 to 6 (3 is the design-token default), the nearest CSS named color is shown when one is close, and a side panel emits a ready-made CSS custom-property declaration plus a Tailwind arbitrary-value class so you can drop the color straight into a stylesheet, a design tokens file, or a JSX className. Useful for converting brand colors into modern CSS Color 4 syntax for design systems, building Tailwind v4 themes, generating perceptually uniform light-and-dark palettes from an OKLCH base, comparing how the same color reads across spaces, prepping wide-gamut tokens for displays that support P3, and exploring the OKLCH cube without leaving the browser. Everything runs locally on your device. Pasted brand colors, design tokens, and unreleased palettes never leave your tab.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Color Format Converter
Convert any CSS color to HEX, RGB, HSL, HWB, CMYK, and named values at once.
Open tool
ConverterHEX to RGB Converter
Convert HEX, RGB, RGBA, and HSL with a live preview.
Open tool
GeneratorColor Mixer
Blend two colors with OKLCH, LAB, HSL, or sRGB and copy the steps.
Open tool
SEOColor Contrast Checker
Check WCAG AA, AAA, and UI contrast ratios with live preview and pass or fail badges.
Open tool
GeneratorColor Shades and Tints Generator
Build a 50 to 900 style ramp of shades and tints from a single hex color.
Open tool
GeneratorColor Palette Generator
Build complementary, analogous, triadic, and monochromatic color schemes from any HEX.
Open tool