HEX to OKLCH
Convert HEX to OKLCH online and for free: paste a hex code and get the oklch() value for your CSS. #0F766E becomes oklch(51.094% 0.08606 186.39). OKLCH is the perceptual color space of CSS Color 4, and Tailwind CSS 4 defines its palette in it. The page also names the nearest Tailwind color. It all runs in your browser.
How to convert HEX to OKLCH
- 1Paste your hex code into "Color", with or without #
- 2Or pick a color with the color picker next to the field
- 3Click "Copy" next to the oklch() value in the big line
- oklch(L C H), ready for a CSS variable
Made for modern CSS
- Written as CSS writes it.Lightness in percent, chroma and hue as plain numbers, so it pastes straight into a stylesheet
- Tailwind next to it.The list shows the nearest Tailwind 4 and Tailwind 3 color, with how close each one is
- Nothing is sent anywhere.Your browser does the math, on your own device
What you can do
- Turn a hex code into oklch() with lightness to three decimals in percent, chroma to five decimals and hue to two
- Copy OKLab as well, the same space with a and b instead of chroma and hue
- Paste rgb(), hsl(), a CSS name or a Tailwind name such as sky-500 instead of a hex code
- See HEX, RGB, HSL, Lab, LCH and XYZ of the same color in one list
Good to know
- Every hex code lies inside sRGB, so its OKLCH value always turns back into the same hex code
- Chroma in OKLCH is small: colors in sRGB stay below about 0.33, and grays are 0. For a gray the hue is written as 0
- OKLCH and LCH are different spaces. Copy the line that says OKLCH, not LCH, when your CSS uses oklch()
Questions
How do I convert hex to OKLCH?
Paste the hex code into the field. The big line shows the oklch() value at once, and "Copy" takes it. #FFC61A, for example, is oklch(85.406% 0.17061 86.92).
Why are people moving their colors to OKLCH?
Its lightness follows what the eye sees, so two colors with the same L look about equally light, whatever their hue. That makes it easier to build palettes, hover states and dark modes by changing one number.
Does every browser understand oklch()?
All current major browsers do. For very old browsers you can keep the hex code as a fallback, and this page gives you both.
Is my color sent to a server?
No. The conversion runs in your browser. No request is made with your color.
More tools in Web & code
That page doesn't exist. Search or drop a file below to find the tool you need.
One site for every file job. What’s yours?
Stop hopping between converter sites. Pick from 410+ tools, or a recipe that chains several.
- Files Stay On Your Device
- No watermark
- Works offline
Drop a file here
A pasted file works too.
or search for a tool
Open an app
From “ugh, this file” to done, in three steps.
- Drop it, or pick a task
No file? Search for what you need. Files are processed on your device, not uploaded for processing.
- Pick what you want
Smaller, another format, signed, merged. One click, no settings to study first.
- Make it a recipe
Need three steps in a row every week? Chain them once and run the same recipe next time.
One approved toolbox for the whole team.
In offices, on building sites and in agencies, teams handle sensitive files all day. ToolRecipe gives everyone the same tools and the same recipes, and the files are processed on each person's own computer.
- Files are processed on the employee's device
- Company recipes everyone runs the same way
- One place instead of ten converter sites