Formats it reads
The input box accepts anything a modern browser understands as a color, plus a couple of extras:
- HEX in 3, 4, 6 or 8 digits:
#F60,#0F766E80 rgb()andrgba(), with commas or spaces, numbers or percentageshsl(),hwb()lab(),lch(),oklab(),oklch()color(srgb …)and similarcolor()strings- the 148 CSS named colors, from
alicebluetoyellowgreen
The line under the input confirms how the color was read, so you can catch a typo before copying anything.
The fourteen outputs
| Row | What it's for |
|---|---|
| HEX | CSS, design tools, anywhere a short code is wanted |
| RGB | modern CSS syntax, rgb(217 72 28) |
| RGB legacy | comma syntax for older tools and email templates |
| HSL | hue, saturation and lightness for quick tweaks in CSS |
| HSV / HSB | the model used by Photoshop, Figma and most pickers |
| HWB | hue with whiteness and blackness, easy to reason about |
| CMYK | formula-based ink percentages for rough print specs |
| Lab | CIE Lab (D50), used in color management and measuring |
| LCH | the cylindrical version of Lab |
| OKLab | a newer perceptual space, good for mixing and gradients |
| OKLCH | the cylindrical form of OKLab, good for palettes and scales |
| XYZ D65 | the device-independent base most conversions pass through |
| sRGB float | channels from 0 to 1, for shaders and native app code |
| Integer | the 24-bit number, such as 14239772 for #D9481C |
Set Decimals to control rounding. Two is a sensible default; use 0 for clean CSS and 4 when you're feeding values into code that will convert them again.
An example
Typing oklch(62% 0.19 37) gives:
#E04F1Frgb(224 79 31)hsl(15 76% 50%)lab(54.3% 56.2 56.5)cmyk(0%, 65%, 86%, 12%)
Compare that with #D9481C, which has an OKLCH of 60.1%, 0.189, 36.2. The two oranges are close but not identical, and converting through OKLCH makes the difference measurable rather than a hunch.
How the conversions work
Everything passes through linear-light sRGB and CIE XYZ:
- The input is parsed into sRGB channels, removing the gamma curve to get linear light.
- A 3×3 matrix gives XYZ under the D65 white point (the white of a standard screen).
- From there, OKLab uses Björn Ottosson's published matrices and a cube root. CIE Lab first adapts XYZ to the D50 white point with the Bradford transform, which matches how CSS defines
lab(). - LCH and OKLCH are the same values in polar form: chroma is the distance from gray, hue is the angle.
HSL, HSV and HWB are simple rearrangements of the gamma-encoded RGB numbers, with no matrix involved. CMYK uses the naive formula described on the RGB to CMYK page.
Out-of-gamut input
oklch() and lab() can describe colors that no sRGB screen can show, such as a very saturated green at high lightness. When you type one, the tool keeps lightness and hue and reduces chroma until the color fits in sRGB. That is the gamut-mapping approach the CSS Color 4 spec recommends. The HEX and RGB rows then describe that mapped color, so converting back won't return your original numbers.
Copying
Every row has its own copy button. Copy all puts every format on the clipboard as labeled lines, which is handy for a design handoff or a ticket. Copies are plain text with no hidden formatting.
Precision notes
- HEX is limited to 256 steps per channel, so it is always rounded. If you need to round-trip Lab or OKLCH values exactly, keep them in that format instead of passing through HEX.
- Lab values here follow CSS (D50). Some older software reports Lab under D65, and the a and b numbers can differ by a few units.
- Hue is undefined for grays. The tool shows 0, which is the CSS convention.
Related tools
For single conversions with a worked explanation, see HEX to RGB and HEX to HSL. To find out what a color is called, use the color name finder. To pick a color visually and get the same readouts, open the HEX color picker.
FAQ
Which format should I use in CSS?
HEX or rgb() for maximum compatibility. oklch() if you want to adjust lightness and chroma predictably. All current browsers support it, and fallbacks are only needed for quite old ones.
Why is CMYK listed if it isn't accurate?
It is useful as a ballpark, and people often need a number for a form. Read the RGB to CMYK guide before using it for real print work.
Is my input stored anywhere?
No. Conversion happens in your browser and nothing is sent to a server.