OKLCH Input
Work with lightness, chroma, and hue instead of RGB channel values.
Convert oklch() colors to HEX, RGB and HSL with proper sRGB gamut handling. Single, slider and bulk modes.
oklch(70% 0.15 250) · oklch(0.7 0.15 250 / 50%) · oklch(60% 0.2 0.5turn)| OKLCH | HEX |
|---|
Convert OKLCH colors to HEX online with a clear, developer-friendly workflow. Understand lightness, chroma, hue, sRGB gamut, color conversion, CSS syntax, and how modern OKLCH colors become familiar HEX values for websites and digital products.
An OKLCH to HEX Converter transforms a color expressed as OKLCH coordinates into a hexadecimal color representation, normally based on the sRGB color space. This is useful when a modern OKLCH color needs to be used in projects, systems, or tools that expect familiar HEX color values.
OKLCH is a modern color model designed to provide a more perceptually oriented way of describing colors. It separates color information into three useful components: lightness, chroma, and hue.
HEX is one of the most widely used color formats on the web. Developers
commonly see values such as #FF0000, #3366FF,
or #111827 in CSS, design systems, graphics software,
website themes, and application interfaces.
An OKLCH to HEX Converter bridges these two workflows. It helps you take an OKLCH color and obtain an sRGB-compatible hexadecimal representation when a HEX value is required.
Work with lightness, chroma, and hue instead of RGB channel values.
Convert colors into the familiar hexadecimal format used across web projects.
Understand why some OKLCH colors require gamut mapping before becoming HEX.
Use converted HEX colors in CSS, design systems, themes, and interfaces.
OKLCH is a cylindrical representation of the OKLab color space. The name comes from its three primary components: Lightness, Chroma, and Hue.
Describes the perceived lightness of the color. In CSS OKLCH syntax, lightness is commonly represented as a percentage.
65%
Represents the colorfulness or intensity of the color. Higher chroma generally means a more vivid color when it remains within the target gamut.
0.18
Represents the position around the hue circle and is normally expressed as an angle in degrees.
250deg
This example describes a color using OKLCH coordinates. The exact resulting HEX value depends on the conversion process and whether the source color is inside the target sRGB gamut.
HEX, short for hexadecimal color notation, represents RGB channel values using hexadecimal digits. A standard six-digit HEX color contains three pairs representing red, green, and blue.
For example, #FF0000 represents maximum red with zero green
and zero blue in the sRGB representation. Likewise, #000000
represents black and #FFFFFF represents white.
OKLCH to HEX conversion is not simply a matter of rearranging numbers. OKLCH and HEX represent colors using different color models and coordinate systems.
A proper conversion generally involves transforming the OKLCH coordinates into OKLab, converting OKLab into a device-oriented color space such as XYZ, and then converting the result into the target RGB color space. When the target is standard web HEX, the relevant destination is normally sRGB.
HEX notation on the web is generally used to describe colors in the sRGB color space. OKLCH, however, can describe colors that fall outside the sRGB gamut.
This creates an important conversion issue. A mathematically valid OKLCH color is not necessarily representable as a normal six-digit sRGB HEX value.
When a source color falls outside the target gamut, a conversion workflow may need to perform gamut mapping or otherwise adjust the color so that it can be represented in sRGB.
If an OKLCH color is outside sRGB, there may not be a HEX value that reproduces the original OKLCH color exactly. The converted HEX is a displayable approximation within the destination gamut.
Describes colors using lightness, chroma, and hue. It is useful for controlled color manipulation and modern CSS workflows.
Represents red, green, and blue channel values using hexadecimal notation and is extremely common in web development.
OKLCH is increasingly useful for modern color workflows, but HEX remains deeply integrated into web development tools and existing codebases. Converting between them allows designers and developers to work in the color model that best fits each part of their workflow.
Use HEX when maintaining projects that already rely heavily on traditional RGB-based color values.
Provide familiar HEX values to teams or systems that do not yet accept OKLCH.
Some platforms and APIs may request hexadecimal color values instead of modern CSS color functions.
Maintain HEX equivalents alongside modern OKLCH design tokens.
Use sRGB HEX values when moving colors into workflows built around RGB.
Compare modern OKLCH colors with their sRGB representations during compatibility and fallback testing.
Modern CSS can use OKLCH directly. If you also need a traditional HEX fallback, you can place both declarations in a stylesheet.
.button {
background: #4f46e5;
background: oklch(55% 0.22 275);
}
The exact fallback HEX should be generated from the actual OKLCH color rather than guessed manually. This is especially important when the source color has high chroma or falls close to a gamut boundary.
Developers working on modern design systems can keep OKLCH as the source color representation while generating HEX values for compatibility, documentation, exports, or systems that require RGB-based colors.
:root {
--brand-oklch: oklch(60% 0.20 270);
--brand-hex: #5b4bd8;
}
.button {
background: var(--brand-hex);
}
@supports (color: oklch(50% 0.1 250)) {
.button {
background: var(--brand-oklch);
}
}
In production systems, the fallback should be calculated from the exact source color and validated visually and technically rather than copied from an unrelated example.
No. This is one of the most important concepts to understand about OKLCH to HEX conversion.
HEX normally represents sRGB. OKLCH can represent colors outside the sRGB gamut. When a color is outside the target gamut, it must be mapped or adjusted before it can be represented as a normal sRGB HEX color.
As a result, the resulting HEX value can be the closest practical representation rather than a mathematically identical representation of the original out-of-gamut OKLCH color.
Accurate conversion requires correct color-space mathematics, proper sRGB transfer functions, numerical precision, and appropriate handling of out-of-gamut colors.
A reliable converter should therefore do more than simply transform three numbers into three RGB channels. The complete color conversion path matters.
Read L, C, and H according to the intended OKLCH syntax.
Apply the appropriate OKLab and XYZ transformations.
Convert into the RGB space used by conventional web HEX notation.
Account for colors that cannot be represented directly in sRGB.
65%
0.18
250deg
OKLCH can be particularly useful when building interface color systems. Designers can adjust lightness and chroma systematically instead of treating every HEX value as an unrelated number.
Once the final colors are selected, HEX equivalents can be generated for documentation, legacy components, export workflows, or applications that still expect hexadecimal values.
Generate HEX fallbacks for primary and secondary button colors.
Convert carefully selected OKLCH backgrounds into sRGB values.
Maintain modern source tokens alongside HEX compatibility values.
Build systematic dark palettes and export compatible HEX colors.
Document brand colors using both modern and traditional formats.
Support systems that require HEX while retaining modern color workflows.
Provide a valid OKLCH value containing lightness, chroma, and hue.
Separate the lightness, chroma, and hue values.
Transform the OKLCH representation through the required color-space conversion steps.
Obtain the RGB representation required for conventional web HEX.
Determine whether the source color fits within the target sRGB gamut.
Encode the final sRGB channel values as a hexadecimal color.
Convert modern colors for websites and applications that require HEX notation.
Maintain compatible color values across modern and legacy components.
Translate finalized OKLCH colors into values supported by older design workflows.
Document brand colors using both perceptual and traditional color formats.
Generate fallback colors for CSS projects using modern color functions.
Compare perceptual color coordinates with familiar RGB-based representations.
These color formats are related but serve different purposes. Understanding their differences helps you select the right representation for a particular design or development task.
Useful for modern perceptual color manipulation.
Cartesian representation of the OKLab color space.
Familiar and convenient for many traditional CSS workflows.
Channel-based representation used widely in digital imaging.
Compact notation for RGB colors commonly used on the web.
Converting a color from OKLCH to HEX does not automatically make the resulting color accessible. Accessibility depends on how colors are used together, especially for text and background combinations.
Lightness can help designers reason about relative brightness, but WCAG contrast should still be tested using an appropriate contrast calculation rather than relying only on the OKLCH lightness value.
Use our Color Contrast Checker and APCA Contrast Checker when evaluating interface colors.
For official accessibility guidance, visit the W3C Web Accessibility Initiative .
Standard HEX web colors normally correspond to the sRGB color space.
High-chroma OKLCH colors may fall outside sRGB.
Avoid unnecessary rounding during intermediate conversion steps.
Compare the resulting color in the actual browser and interface context.
Check text and background contrast separately from color conversion.
Keep OKLCH as a source format when it provides useful control for your design system.
Continue your color workflow with other BestColorPicker tools for conversion, selection, comparison, harmony, and accessibility testing.
An OKLCH to HEX Converter transforms an OKLCH color into a hexadecimal representation, normally targeting the sRGB color space used by conventional web HEX colors.
OKLCH is converted through the appropriate color-space transformations into sRGB RGB channel values, after which the RGB channels can be encoded as a hexadecimal color.
L represents lightness, C represents chroma, and H represents hue. Together they describe an OKLCH color.
OKLCH describes colors using lightness, chroma, and hue, while HEX is hexadecimal notation for RGB channel values commonly used on the web.
Every valid OKLCH color can be processed toward an RGB representation, but colors outside the target sRGB gamut cannot always be represented exactly by a standard HEX value. Gamut mapping may be required.
In normal web usage, HEX notation is generally interpreted as RGB values in the sRGB color space.
OKLCH and sRGB have different gamuts and color representations. If an OKLCH color is outside sRGB, it may need to be mapped into the destination gamut before it can be represented as HEX.
Yes. Modern CSS supports the oklch() color function. Browser support should be considered according to the browsers your project needs to support.
HEX may be required by legacy websites, third-party tools, design systems, APIs, documentation, graphics workflows, or applications that do not accept modern OKLCH syntax.
They serve different purposes. OKLCH is useful for perceptual color manipulation, while HEX is a compact and widely supported notation for RGB colors on the web.
A properly implemented conversion can accurately transform in-gamut colors into sRGB HEX. Out-of-gamut colors require gamut mapping or approximation, so the resulting HEX may not reproduce the original OKLCH color exactly.
A browser-based OKLCH to HEX converter can provide free color conversion without requiring desktop color software or manual calculations.
Move between modern perceptual color workflows and familiar web color notation with a practical OKLCH to HEX conversion process.
Open OKLCH to HEX Converter