Skip to content

OKLCH to Hex Converter

Convert modern CSS oklch() colors to hex codes. Paste a value like oklch(63.7% 0.237 25.331) - from Tailwind CSS v4, design tokens, or any modern stylesheet - and copy the hex equivalent. All conversions happen in your browser.

OKLCH to hex examples (Tailwind CSS v4)

oklch(63.7% 0.237 25.331) = #FB2C36

  • oklch(65.6% 0.241 354.308) = #F6339A (pink-500)
  • oklch(55.8% 0.288 302.321) = #9810FA (purple-600)
  • oklch(54.6% 0.245 262.881) = #155DFC (blue-600)
  • oklch(55.4% 0.046 257.417) = #62748E (slate-500)
  • oklch(43.9% 0 0) = #525252 (neutral-600)
red-500 in Tailwind v4. Colors outside the sRGB gamut have no exact hex; the converter says so and keeps lightness and hue while reducing chroma.

Synchronized color

#FB2C36

Parsed as RGB; malformed or out-of-range channels are rejected, never silently clamped.

Try: oklch(63.7% 0.237 25.331), oklch(0.7 0.1 200), or #FB2C36

100%

Adjust channels

251
44
54

Share this exact input

?color=FB2C36

One input, implementation-ready output

Color workspace

Hex

#RRGGBB

#FB2C36

CSS RGB

Modern space syntax

rgb(251 44 54)

Legacy RGB

Comma syntax

rgb(251, 44, 54)

RGB %

Percentage channels

rgb(98.4% 17.3% 21.2%)

HSL

CSS hue, saturation, lightness

hsl(357 96% 58%)

HSV / HSB

Design-tool model

hsv(357, 82%, 98%)

OKLCH

Perceptual CSS color

oklch(63.78% 0.2373 25.44)

LAB

CSS Lab, D50

lab(55.58% 75.14 49.16)

LCH

CSS LCH, D50

lch(55.58% 89.79 33.19)

CMYK

Unprofiled approximation

cmyk(0%, 82%, 78%, 2%)

How OKLCH Converts to Hex

The conversion reverses the OKLab math and re-applies the sRGB gamma curve:

  1. Convert the polar OKLCH form back to OKLab: a = C × cos(H), b = C × sin(H).
  2. Transform OKLab to the LMS cone space, cube each component.
  3. Transform LMS to linear RGB with the inverse matrix.
  4. Apply sRGB gamma, scale to 0-255, and write each channel as a hex pair. If a linear channel falls outside 0-1 the color is out of the sRGB gamut: this converter then lowers chroma at the same lightness and hue until it fits.

Example: convert oklch(63.7% 0.237 25.331) to hex

a = 0.237 × cos(25.331°) = 0.214, b = 0.237 × sin(25.331°) = 0.101

OKLab (0.637, 0.214, 0.101) → linear RGB (0.961, 0.025, 0.037)

Gamma-corrected: rgb(251, 44, 54)

Result: #FB2C36 - Tailwind v4 red-500

How to Use the OKLCH to Hex Converter

Paste an oklch() value such as oklch(63.7% 0.237 25.331) and the hex code, #FB2C36, appears immediately with a live preview. The output panel also shows RGB, HSL, and CMYK, each with one-click copy. If the value is outside the sRGB gamut, the converter says so and reduces chroma at the same lightness and hue to the nearest color a screen can show.

From Modern CSS Back to Classic Formats

OKLCH is quickly becoming the source of truth in modern design systems, but the rest of the world still speaks hex. This converter bridges the gap using the reference OKLab math, so the hex you copy renders identically to the oklch() value in the browser.

Common Use Cases

Extracting hex codes from Tailwind CSS v4 theme values, converting oklch() colors from a design system into formats that Figma plugins or email tools accept, and checking what an OKLCH color looks like when clamped to the sRGB gamut.

OKLCH to Hex Conversion Table

OKLCH, RGB, and hex values for the most commonly used colors. Click any hex code to load it into the converter above.

ColorNameHexRGBOKLCH
Black#000000rgb(0, 0, 0)oklch(0% 0 0)
White#FFFFFFrgb(255, 255, 255)oklch(100% 0 0)
Red#FF0000rgb(255, 0, 0)oklch(62.8% 0.2577 29.23)
Lime#00FF00rgb(0, 255, 0)oklch(86.64% 0.2948 142.5)
Blue#0000FFrgb(0, 0, 255)oklch(45.2% 0.3132 264.05)
Yellow#FFFF00rgb(255, 255, 0)oklch(96.8% 0.211 109.77)
Cyan#00FFFFrgb(0, 255, 255)oklch(90.54% 0.1546 194.77)
Magenta#FF00FFrgb(255, 0, 255)oklch(70.17% 0.3225 328.36)
Silver#C0C0C0rgb(192, 192, 192)oklch(80.78% 0 0)
Gray#808080rgb(128, 128, 128)oklch(59.99% 0 0)
Maroon#800000rgb(128, 0, 0)oklch(37.67% 0.1546 29.23)
Olive#808000rgb(128, 128, 0)oklch(58.07% 0.1266 109.77)
Green#008000rgb(0, 128, 0)oklch(51.98% 0.1769 142.5)
Purple#800080rgb(128, 0, 128)oklch(42.09% 0.1935 328.36)
Teal#008080rgb(0, 128, 128)oklch(54.31% 0.0927 194.77)
Navy#000080rgb(0, 0, 128)oklch(27.11% 0.1879 264.05)
Orange#FFA500rgb(255, 165, 0)oklch(79.27% 0.171 70.67)
Pink#FFC0CBrgb(255, 192, 203)oklch(86.77% 0.0735 7.09)
Gold#FFD700rgb(255, 215, 0)oklch(88.68% 0.1822 95.33)
Brown#A52A2Argb(165, 42, 42)oklch(48.06% 0.1597 25.56)
Coral#FF7F50rgb(255, 127, 80)oklch(73.51% 0.168 40.25)
Indigo#4B0082rgb(75, 0, 130)oklch(33.9% 0.1793 301.68)
Violet#EE82EErgb(238, 130, 238)oklch(76.19% 0.1861 327.21)
Salmon#FA8072rgb(250, 128, 114)oklch(73.5% 0.1515 28.06)

Need a value that is not listed? Browse the full color library — every hex code has a page with its RGB, HSL, CMYK and OKLCH values, contrast ratios, tints, shades and matching palette colors.

Frequently Asked Questions about OKLCH to Hex Converter

Use the CSS syntax: oklch(62.3% 0.214 259.8). The lightness accepts either a percentage or a 0-1 decimal, and the deg suffix on the hue is optional. Values are space-separated, matching how browsers and Tailwind write them.