Skip to content
Jellykit

Color Converter

Convert a color between HEX, RGB, HSL, HWB, OKLCH, LAB and CMYK, with a copy button for each and its contrast against white and black.

  • Runs on your device
Loading tool

About Color Converter

Type or pick a color in any CSS notation and get it in every other one: HEX, RGB, HSL, HWB, the perceptual OKLCH and OKLab spaces, CIE LAB and LCH, and an approximate CMYK. Each value is formatted as valid CSS and has its own copy button.

The contrast ratios against white and black tell you at a glance which text color will be readable on it under WCAG.

How it works

  1. The input is parsed as a CSS color: a hex code, a named color, or a function such as rgb(), hsl() or oklch(). Out-of-range values in rgb(), hsl() and hwb() are clamped, as a browser clamps them.
  2. It is converted through linear-light sRGB into each target color space using the standard CSS Color Level 4 formulas.
  3. Contrast is the WCAG 2 ratio of relative luminance between your color and pure white or black. A translucent color is measured at its worst: under white text as if the page behind it were white, and under black text as if it were black.

Questions

Why should I care about OKLCH?

In OKLCH, equal changes in lightness look equally large to the eye, and hue stays stable as you lighten or darken. That makes it much easier to build palettes and accessible color scales than with HSL.

How accurate is the CMYK value?

It is the simple mathematical conversion with no ink or paper profile, so treat it as a starting point. For print work, convert with the ICC profile your printer specifies.

What does "outside sRGB" mean?

Wide-gamut notations such as oklch() can describe colors that ordinary screens cannot show. The HEX, RGB and HSL values are then the nearest displayable color rather than an exact match.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.