RGB to OKLCH
Convert RGB to OKLCH for free: type red, green and blue from 0 to 255 and get the oklch() value to move an existing palette into modern CSS. rgb(59, 130, 246) becomes oklch(62.308% 0.18801 259.81). With your colors in OKLCH, a lighter or darker shade is just a change of the first number. It runs in your browser.
How to convert RGB to OKLCH
- 1Type R, G and B into "Color", such as 59 130 246
- 2Or paste rgb(59, 130, 246), a hex code or a CSS name
- 3Copy the oklch() value from the big line
- Your RGB color as oklch(L C H) for your stylesheet
Good for a palette move
- Bare numbers work.On this page 59 130 246 is read as RGB, with spaces or commas between the numbers
- Same color, more views.OKLab, Lab, LCH, HSL and HEX of the color are listed too, each with a copy button
- Nothing is sent anywhere.Your browser works out the values, on your own device
What you can do
- Turn RGB from 0 to 255, or rgb() with percentages, into oklch() with L in percent
- Use the color picker to pick a color: the field writes it as rgb(), the OKLCH value follows
- See the nearest Tailwind 4 color, whose palette is defined in OKLCH, and the nearest Tailwind 3 color and CSS name
- Copy OKLab too, if your code mixes or blends colors in that space
Good to know
- RGB is taken as sRGB, the color space of the web. Every sRGB color fits into OKLCH, so nothing is moved or cut in this direction
- Each channel runs from 0 to 255. A value outside that range gives a message instead of a color
- For grays the chroma is 0 and the hue has no meaning, so the hue is written as 0
Questions
How do I convert RGB to OKLCH?
Type the three RGB numbers into the field. The oklch() value appears in the big line right away. 34 197 94, for example, gives oklch(72.275% 0.19201 149.58).
What do the three OKLCH numbers mean?
L is lightness from 0% (black) to 100% (white). C is chroma, how colorful the color is, from 0 for gray up to about 0.32 in sRGB. H is the hue angle from 0 to 360.
Will the color look the same after converting?
Yes. The oklch() value describes the same color as your RGB, and it turns back into the same RGB numbers. Only the way of writing it changes.
Is my color uploaded anywhere?
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