How do I convert OKLCH to HEX?
Paste the oklch() value into the converter above. It turns OKLCH into OKLab, then linear sRGB, and finally rounds the red, green and blue channels to 0–255 values written as a HEX code.
To convert OKLCH to HEX, turn oklch(L C H) into OKLab, then into linear sRGB and gamma-encoded RGB, and write each channel as two hex digits: oklch(62.8% 0.258 29.23) is #ff0000. Colours outside the sRGB gamut are pulled back in by lowering chroma to the nearest displayable HEX.
To convert OKLCH to HEX, the oklch() value is turned into OKLab, then linear sRGB, then 0-255 channels written as a HEX code; colours outside sRGB are pulled back in by lowering chroma. Paste an oklch() value below.
oklch(54.6% 0.245 262.9)#155dfcrgb(21, 93, 252)hsl(221, 97%, 54%)| Name | oklch() | HEX | rgb() | In sRGB? |
|---|---|---|---|---|
| red-500 | oklch(63.7% 0.237 25.331) | #fb2c36 | rgb(251, 44, 54) | Yes |
| orange-500 | oklch(70.5% 0.213 47.604) | #fc7100 | rgb(252, 113, 0) | outside sRGB, clipped |
| amber-500 | oklch(76.9% 0.188 70.08) | #f69e00 | rgb(246, 158, 0) | outside sRGB, clipped |
| green-500 | oklch(72.3% 0.219 149.579) | #00c65a | rgb(0, 198, 90) | outside sRGB, clipped |
| blue-500 | oklch(62.3% 0.214 259.815) | #3280ff | rgb(50, 128, 255) | outside sRGB, clipped |
| violet-500 | oklch(60.6% 0.25 292.717) | #8d56ff | rgb(141, 86, 255) | outside sRGB, clipped |
| pink-500 | oklch(65.6% 0.241 354.308) | #f6339a | rgb(246, 51, 154) | Yes |
| slate-500 | oklch(55.4% 0.046 257.417) | #62748e | rgb(98, 116, 142) | Yes |
OKLCH can describe colours outside sRGB, but HEX can only encode sRGB channels from 0 to 255. If a computed channel falls outside that range, there is no exact HEX equivalent. This converter keeps the lightness and hue and lowers the chroma until the colour fits, then labels the result so you know it is a clipped sRGB fallback.
Paste the oklch() value into the converter above. It turns OKLCH into OKLab, then linear sRGB, and finally rounds the red, green and blue channels to 0–255 values written as a HEX code.
The colour is outside the sRGB range that HEX can represent. The converter lowers its chroma until it fits sRGB while keeping the lightness and hue, so the HEX code is the nearest displayable fallback rather than an exact match.
Yes. All current major browsers support oklch(), so you can use it directly for modern CSS. Convert it to HEX when a design tool, older browser or another system needs an sRGB code.
Copy the oklch() value from your Tailwind CSS v4 theme or generated CSS, then paste it into the converter above. The table also lists the HEX equivalents for eight common Tailwind v4 500-step colours.