OKLCH to HEX and RGB Color Converter
Convert OKLCH to HEX, RGB and HSL with this free online OKLCH color converter. Use the OKLCH to HEX converter for hexadecimal values and get RGB color values for CSS and design tools. You can also convert multiple OKLCH colors from a stylesheet or Tailwind CSS theme.
Paste oklch(), type values like 70% 0.15 200, or pick a colour. HEX, RGB, HSL and OKLab work too.
HEX, RGB, RGBA and other formats
rgb(43, 127, 255)rgba(43, 127, 255, 1)hsl(216.3 100% 58.5%)rgb(43 127 255)oklch(62.3% 0.214 259.815)oklab(62.3% -0.038 -0.211)The HEX value is oklch(61.9% 0.207 259.253) in OKLCH: same lightness and hue, less chroma.
CSS with a fallback
color: #2b7fff; color: oklch(62.3% 0.214 259.815);
Browsers that do not understand oklch() ignore the second line and keep the HEX colour.
Convert every oklch() in a stylesheet
Paste CSS, a Tailwind @theme block or a list of colours. Each oklch() value is replaced with its HEX; everything else is left as it is.
Related Developer Tools
How to Convert OKLCH to HEX and RGB
Use this OKLCH to HEX and RGB converter to change modern CSS color values into formats supported by your project or design tool.
- Enter an OKLCH color: Paste a CSS value such as
oklch(62.3% 0.214 259.815)into the input field. - Adjust the color: Change lightness, chroma, hue or opacity using the available controls.
- Get the color codes: View the HEX, RGB, RGBA, HSL, OKLCH and OKLab values provided by the converter.
- Check gamut mapping: If the color falls outside the sRGB gamut, review the mapped result or compare it with clipping if that option is available.
- Copy the result: Copy the required color code or use the generated CSS fallback in your stylesheet.
The converter makes it easier to convert OKLCH to HEX or RGB without manually working through color-space calculations.
What Is an OKLCH to HEX Converter?
An OKLCH to HEX converter changes a color defined with the CSS oklch() function into a hexadecimal color code, such as #2b7fff. OKLCH describes a color using lightness, chroma and hue, while HEX represents its red, green and blue channels using hexadecimal digits.
Developers may need to convert OKLCH to HEX when working with existing CSS projects, design systems, graphics software, email templates or applications that accept HEX values but do not support OKLCH.
This tool also provides RGB and HSL values, so you can use it as an OKLCH color converter when you need another common color format.
Convert OKLCH to RGB
RGB represents a color through its red, green and blue channel values. While OKLCH is useful for adjusting perceived lightness and color intensity, RGB is widely used in graphics software, programming interfaces and CSS color definitions.
To convert OKLCH to RGB, enter the original oklch() color into the converter and read the RGB value in the output. You can then copy that value for a project that expects RGB channels instead of HEX.
For example, a CSS color can be represented using different syntaxes:
/* OKLCH */
color: oklch(62.3% 0.214 259.815);
/* HEX */
color: #2b7fff;
/* RGB */
color: rgb(43, 127, 255);These HEX and RGB values are illustrative and are not guaranteed to represent the exact OKLCH example above. Use the converter's actual output for the correct equivalent.
RGB values use the sRGB color space when represented in conventional CSS rgb() syntax. If the original OKLCH color falls outside the sRGB gamut, the resulting RGB value may be a mapped approximation.
OKLCH to HEX, RGB and HSL: What's the Difference?
HEX, RGB and HSL represent colors in different ways. Choosing the right format depends on the application, stylesheet or design workflow you are using.
| Color format | How it represents a color | Common use |
|---|---|---|
| OKLCH | Lightness, chroma and hue | Perceptual color adjustments and modern CSS palettes |
| HEX | Hexadecimal red, green and blue channels | Web design, themes and design tools |
| RGB | Red, green and blue channel values | CSS, graphics tools and programming |
| HSL | Hue, saturation and lightness | Simple color adjustments and CSS styling |
Use the OKLCH to HEX converter when a tool requests a hexadecimal color. Choose the RGB output when your workflow needs red, green and blue values. HSL can be useful when you prefer to adjust a color by hue, saturation and lightness.
Understanding OKLCH Values: Lightness, Chroma and Hue
A CSS oklch() color generally contains three main components, with an optional alpha value for transparency.
| Component | Meaning | Example |
|---|---|---|
| Lightness (L) | Perceived brightness from black to white | 62.3% |
| Chroma (C) | Color intensity | 0.214 |
| Hue (H) | Position around the color wheel in degrees | 259.815 |
| Alpha (A) | Optional opacity | / 50% |
For example, oklch(62.3% 0.214 259.815) describes a color using these three main components. The converter translates the input into the supported output formats.
Increase lightness to make a color brighter, reduce chroma for a less vivid appearance, or adjust hue to move toward another color family. These controls can be useful when building a consistent UI color palette.
Why Convert OKLCH to HEX or RGB?
OKLCH is useful for working with perceptually consistent palettes, while HEX and RGB are widely used across web development and design applications. Converting between these formats can help you:
- Use colors in existing projects: Convert modern CSS colors into a format accepted by an existing stylesheet or design tool.
- Create CSS fallbacks: Provide a HEX or RGB declaration before a newer OKLCH declaration.
- Work with design systems: Convert color variables into the formats required by different tools.
- Prepare email templates: Use conventional color formats when an email workflow does not support OKLCH.
- Share colors with designers: Provide HEX and RGB values that are easy to copy into design software.
- Convert multiple CSS colors: Process supported OKLCH values from a stylesheet or Tailwind CSS theme instead of converting each color individually.
If you are building a new CSS palette, you can keep OKLCH for modern browsers while providing HEX or RGB fallbacks where needed.
Gamut Mapping vs. Clipping in OKLCH Conversion
Not every color described in OKLCH can be represented exactly in HEX or conventional sRGB RGB values. OKLCH can describe more saturated colors that fall outside the sRGB gamut.
When an input color falls outside sRGB, the converter needs to find a representable color. Two approaches are gamut mapping and channel clipping.
Gamut mapping adjusts chroma as needed while aiming to preserve the original lightness and hue. This can help retain the overall appearance of a color.
Channel clipping limits red, green and blue channels to the available sRGB range. Depending on the input, this can change the apparent hue, brightness or saturation.
This converter supports CSS Color 4-style gamut mapping and provides a clipping option for comparison. The resulting HEX or RGB value may be an approximation when the original color is outside the sRGB gamut.
Convert OKLCH to HEX in CSS and Tailwind CSS
Modern CSS supports the oklch() function, and Tailwind CSS v4 uses OKLCH values in its default theme. However, you may still need HEX or RGB equivalents for older projects, external tools or existing components.
For example, you can provide a HEX fallback before an OKLCH declaration:
.button {
color: #2b7fff;
color: oklch(62.3% 0.214 259.815);
}The browser uses the later declaration when it supports OKLCH. Otherwise, it can retain the earlier HEX declaration.
If you need to convert Tailwind CSS colors to HEX, copy the relevant @theme block or individual OKLCH values into the stylesheet conversion feature. Review the generated CSS before using it in production, especially when your project uses wide-gamut colors or transparency.
Convert an Entire CSS Stylesheet to HEX
Converting colors one by one can be time-consuming when a stylesheet contains many OKLCH values. Use the stylesheet conversion feature to paste CSS, a Tailwind @theme block or a list of colors.
The tool replaces supported oklch() values with HEX equivalents while leaving other stylesheet content in place. This can help when migrating color definitions, sharing a design system with another team or preparing a project for software that expects HEX colors.
If you need RGB values instead, use the individual color converter to view and copy the RGB output. Review the results before using them in production, particularly when the original colors are outside the sRGB gamut.
For the reverse conversion, use the HEX to OKLCH Converter.
Frequently Asked Questions
How do I convert OKLCH to HEX?
Paste an oklch() value into the converter. It calculates the corresponding HEX color code and displays other supported formats. You can copy the HEX result directly into your stylesheet or design tool.
How do I convert OKLCH to RGB?
Enter the OKLCH color and read the RGB value displayed by the converter. Copy the red, green and blue channel values for use in CSS or another application that accepts RGB colors.
Can I convert OKLCH to HEX and RGB at the same time?
Yes. The converter displays HEX and RGB alongside other supported color formats. Enter the OKLCH value once, then copy whichever output you need.
What is an OKLCH color converter used for?
An OKLCH color converter changes CSS oklch() values into other color formats, such as HEX and RGB. It is useful for developers, designers and anyone working with color values across different web and design tools.
Is this OKLCH to HEX converter free?
Yes. You can use the online converter to process supported color values and copy the generated results without manually calculating the color channels.
Why does my HEX or RGB color look different from the original OKLCH color?
OKLCH can describe colors outside the sRGB gamut, while conventional HEX and RGB values represent sRGB colors. When the original color falls outside that range, it must be mapped or clipped to a representable color. The resulting color may look less saturated or slightly different.
What is the difference between OKLCH and RGB?
OKLCH represents a color using lightness, chroma and hue. RGB represents it using red, green and blue channel values. OKLCH is useful for perceptual color adjustments, while RGB is a common format for CSS, graphics and programming workflows.
Can I convert OKLCH to RGBA?
Yes. The converter shows an RGBA value for every color, such as rgba(43, 127, 255, 1). Add opacity to your OKLCH color, for example oklch(62.3% 0.214 259.815 / 50%), or use the opacity slider, and the RGBA output changes to rgba(43, 127, 255, 0.5). Copy it directly into your CSS or design tool.
Can I convert multiple OKLCH colors at once?
Yes. Use the stylesheet conversion feature to paste CSS, a Tailwind CSS theme block or a list of colors. Supported OKLCH declarations can be converted together, which saves time when working with multiple color variables.
How do I convert Tailwind CSS v4 colors to HEX?
Copy the relevant @theme block or individual OKLCH values from your Tailwind CSS v4 project and paste them into the stylesheet conversion feature. Review the generated HEX values and CSS before using the result.
Can I use HEX as a fallback for OKLCH?
Yes. Place the HEX declaration before the OKLCH declaration in your CSS. Browsers that support OKLCH can use the newer declaration, while browsers that do not support it can fall back to the earlier HEX value.
Is OKLCH to HEX conversion always exact?
For colors inside the sRGB gamut, conversion can be exact to the precision supported by the output format, subject to rounding. For out-of-gamut colors, the converter must create a mapped or clipped approximation because standard HEX values cannot represent every OKLCH color.
Does the converter support transparency?
Yes. Add an alpha value after a slash in the oklch() input or use the opacity slider. Each output keeps the transparency in its own syntax: HEX becomes an eight-digit code such as #2b7fff80, RGBA shows rgba(43, 127, 255, 0.5), and HSL and OKLCH add / 0.5 at the end. The stylesheet converter also keeps the alpha of each color. Check that your target application supports the format you copy, because some older tools do not accept eight-digit HEX codes.
What is the difference between HEX, RGB and HSL?
HEX uses hexadecimal channel values, RGB uses red, green and blue numbers, and HSL describes hue, saturation and lightness. All can represent colors, but each format offers a different way to specify and adjust them.