Skip to main content
NyankoTools

Color Space Converter (RGB, CMYK, Lab, OKLCH, HWB)

Converts colors between RGB, HEX, HSL, CMYK, HWB, Lab and OKLCH in real time. Enter a value in any field, or pick a color with the color picker, and the other formats update automatically. Lab, OKLCH and HWB are shown in a form you can paste straight into CSS lab(), oklch() and hwb(). Everything happens in your browser, and nothing you type is ever sent to a server. If HEX, RGB and HSL are all you need, the simpler Color Converter is also available.

🔒 Runs in your browser · Your data is never sent to a server

Notes

  • CMYK uses a simple formula without an ICC profile. Real print colors depend on the paper, ink and profile, so use your DTP software or print shop specifications when matching printed colors.
  • RGB, HEX and HSL are sRGB. Lab uses the D50 white point (same as CSS lab()), and OKLCH follows the CSS Color 4 oklch() definition. Values may differ from D65-based Lab in tools such as Photoshop.
  • Lab and OKLCH can describe colors that sRGB cannot display. If you enter such a value, the other formats show the closest displayable color and a notice appears.
  • An invalid value leaves the other fields unchanged and shows an error. Plain comma-separated numbers (e.g. 76, 47, 0, 4) are also accepted. Transparency (alpha) is not supported and is ignored.
  • Displayed values are rounded, so converting back from another format can differ by about ±1.

Glossary

CMYK

A print-oriented model that describes a color by the amounts of Cyan, Magenta, Yellow and blacK ink. This tool uses a simple formula, so results do not match real printed colors exactly.

HWB

A model that takes a Hue and the amounts of Whiteness and Blackness mixed in. It makes it easy to think in terms of "how much white or black to add to this color". Usable in CSS hwb().

Lab (CIE Lab)

A color space with a lightness axis (L) and red-green (a) and yellow-blue (b) axes. It is designed so distances roughly match perceived differences, and is used for measuring color difference. CSS lab() uses the D50 white point.

OKLCH

The perceptually uniform OKLab expressed as Lightness (L), Chroma (C) and Hue (H). Changing the hue keeps perceived lightness fairly steady, which suits gradients and palette generation. Usable in CSS oklch().

sRGB and gamut

sRGB is the standard color space for the web and typical displays. A gamut is the range of colors a space can represent; Lab and OKLCH include colors outside the sRGB gamut.

FAQ

Does the RGB to CMYK result match what will be printed?

No. The CMYK here is a simple formula without an ICC profile, a mechanical re-expression of the on-screen RGB color. Printed color varies with paper and ink, so follow your print shop or DTP software for color matching.

When should I use Lab versus OKLCH?

For CSS work, OKLCH is handy because perceived lightness stays steadier when you change hue or chroma. Use Lab for measuring color differences or when you already have Lab values. The Lab here is D50, same as CSS lab().

Why does it say the color was rounded when I enter Lab or OKLCH?

Lab and OKLCH can describe vivid colors that an sRGB display cannot show. Such values are rounded to the closest displayable color before the other formats are filled in, so converting back will not reproduce the original value.

Why do my Lab values differ from Photoshop?

Many tools such as Photoshop use a D65-based Lab, while CSS lab() and this tool use D50. A different white point shifts the a and b values slightly even for the same color.

Share this page

↑↓ Select Enter Open Esc Close