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)
Synchronized color
#FB2C36Parsed 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
Adjust channels
Share this exact input
?color=FB2C36One input, implementation-ready output
Color workspace
Hex
#RRGGBB
#FB2C36CSS 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:
- Convert the polar OKLCH form back to OKLab: a = C × cos(H), b = C × sin(H).
- Transform OKLab to the LMS cone space, cube each component.
- Transform LMS to linear RGB with the inverse matrix.
- 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.
| Color | Name | Hex | RGB | OKLCH |
|---|---|---|---|---|
| Black | #000000 | rgb(0, 0, 0) | oklch(0% 0 0) | |
| White | #FFFFFF | rgb(255, 255, 255) | oklch(100% 0 0) | |
| Red | #FF0000 | rgb(255, 0, 0) | oklch(62.8% 0.2577 29.23) | |
| Lime | #00FF00 | rgb(0, 255, 0) | oklch(86.64% 0.2948 142.5) | |
| Blue | #0000FF | rgb(0, 0, 255) | oklch(45.2% 0.3132 264.05) | |
| Yellow | #FFFF00 | rgb(255, 255, 0) | oklch(96.8% 0.211 109.77) | |
| Cyan | #00FFFF | rgb(0, 255, 255) | oklch(90.54% 0.1546 194.77) | |
| Magenta | #FF00FF | rgb(255, 0, 255) | oklch(70.17% 0.3225 328.36) | |
| Silver | #C0C0C0 | rgb(192, 192, 192) | oklch(80.78% 0 0) | |
| Gray | #808080 | rgb(128, 128, 128) | oklch(59.99% 0 0) | |
| Maroon | #800000 | rgb(128, 0, 0) | oklch(37.67% 0.1546 29.23) | |
| Olive | #808000 | rgb(128, 128, 0) | oklch(58.07% 0.1266 109.77) | |
| Green | #008000 | rgb(0, 128, 0) | oklch(51.98% 0.1769 142.5) | |
| Purple | #800080 | rgb(128, 0, 128) | oklch(42.09% 0.1935 328.36) | |
| Teal | #008080 | rgb(0, 128, 128) | oklch(54.31% 0.0927 194.77) | |
| Navy | #000080 | rgb(0, 0, 128) | oklch(27.11% 0.1879 264.05) | |
| Orange | #FFA500 | rgb(255, 165, 0) | oklch(79.27% 0.171 70.67) | |
| Pink | #FFC0CB | rgb(255, 192, 203) | oklch(86.77% 0.0735 7.09) | |
| Gold | #FFD700 | rgb(255, 215, 0) | oklch(88.68% 0.1822 95.33) | |
| Brown | #A52A2A | rgb(165, 42, 42) | oklch(48.06% 0.1597 25.56) | |
| Coral | #FF7F50 | rgb(255, 127, 80) | oklch(73.51% 0.168 40.25) | |
| Indigo | #4B0082 | rgb(75, 0, 130) | oklch(33.9% 0.1793 301.68) | |
| Violet | #EE82EE | rgb(238, 130, 238) | oklch(76.19% 0.1861 327.21) | |
| Salmon | #FA8072 | rgb(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.
Plenty of tools still only accept hex: design software, email templates, brand documents, chart libraries, and older codebases. Converting lets you take colors from a modern OKLCH-based system like Tailwind v4 into any legacy workflow.
For colors inside the sRGB gamut, yes - OKLCH and hex describe the same color exactly. Very high-chroma OKLCH values can exceed what sRGB can display; those are clamped to the nearest displayable color, which is the same thing browsers do on sRGB screens.
Tailwind v4 defines red-500 as oklch(63.7% 0.237 25.331), which is #FB2C36 in sRGB. Some Tailwind colors, such as blue-500 at oklch(62.3% 0.214 259.815), sit slightly outside sRGB, so their hex depends on how the gamut is handled: clipping each channel gives #2B7FFF, while reducing chroma at the same lightness and hue, as this converter does, gives #3280FF. Our Tailwind color chart lists the clipped hex for the whole default palette.
Keep the color moving
Useful next steps
Your latest color stays in the local workspace when the next tool uses it.
Hex to OKLCH Converter
Convert hex colors to the modern CSS oklch() format
RGB to Hex Converter
Convert RGB and alpha to Hex, CSS formats, color spaces, code, and states
HSL to Hex Converter
Convert HSL values to hex color codes instantly
Tailwind CSS Color Palette
The full Tailwind CSS v4 color palette in hex and OKLCH