HEX to OKLCH converter.
Type a hex color and get its OKLCH value for Tailwind v4 and modern CSS, with the nearest Tailwind shade and a theme variable to paste.
HEX to OKLCH converter.
Need the UI around it? With Pro, your AI agent builds the form, the result card and the rest of the page from a prompt.
Get ProHow it works
3 steps, no account. It runs in your browser and nothing is uploaded.
Type the hex code
In 3, 4, 6 or 8 digits, with or without the #.
Read the OKLCH
Lightness, chroma and hue appear under it.
Copy it
Copy it, or the Tailwind v4 theme line from the variable panel.
Related tools
More color tools. Every one free, in the browser.
Pricing
Build it with Pro
The tool is free. Pro adds 6,000+ blocks, premium templates and the MCP server, so your AI editor builds the product around it.
4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.
- Secure checkout via Stripe
- Code lives in your repo
- Keep what you've shipped if you cancel
- License terms
Questions and answers
Before you trust the result: what to know about the format, the limits, your data and the tools next to it.
L is perceived lightness from 0% (black) to 100% (white), C is chroma, how colorful, from 0 (gray) up to about 0.37 for the most vivid colors a screen shows, and H is the hue angle in degrees. oklch(62.3% 0.188 259.8) is a mid, strong blue.
Tailwind CSS v4 defines its whole palette in OKLCH, and modern CSS reads it everywhere. Because its lightness is perceptual, you can build shades by changing L alone, and hover states, disabled states and dark-mode variants stay in the same hue family.
Hex to RGB, RGB decoded to linear light, then through the OKLab matrices to lightness, a and b, and from a and b to chroma and hue. The converter follows CSS Color 4's math, so the browser reads back the same color.
Yes: hex is sRGB, and OKLCH holds every sRGB color, so converting back gives the same hex. The converter writes lightness to two decimals in percent and chroma to four, enough for that round trip.
Under the answer, with its class and how close it is in ΔE OK, so you can see whether a Tailwind shade already matches your hex.
No. The conversion runs in your browser.
No. The HEX to OKLCH converter is free and opens without a sign-in, an account or an install.
Nothing. The HEX to OKLCH converter holds your input in the page's memory, so closing or reloading the tab clears it, and it saves nothing in this browser.
Closest to the HEX to OKLCH converter: OKLCH to HEX converter, Color converter, Tailwind color generator, Tailwind color finder. Each opens on its own page, free and in the browser.
The HEX to OKLCH converter is one of 17 in its group. The group's page, /tools/color, lists them all.
The tool is free. Its interface is built from shadcn.io's own components (Button, Input, Slider and the rest of the registry under /ui), which come in React, Vue, Svelte and Solid. Pro adds the blocks and templates for the product around it.
4.9 out of 5 from 150+ developers
Build the product around it
Every block, template and icon, installed by your AI agent in your theme. The tools stay free.
Get Pro



