CSS Color Converter
Convert between Hex, RGB, HSL, HSV, CMYK, and CIE Lab. Live preview + copy-ready outputs.
How to Use
- Paste a color in any supported format (Hex, rgb(), hsl(), etc.).
- Or use the picker to choose a color visually.
- Copy outputs in the format you need (CSS-ready strings included).
- Use “Share Link” only when you want a URL that restores this state.
Live Preview
Swatch updates from your input. Copy formats on the right.
Hex
—
RGB
—
HSL
—
Aa Preview Text
Tip: Outputs are normalized and clamped to valid ranges.
Show Work (details & intermediate values)
—
Work shows normalized math steps (sRGB ↔ linear ↔ XYZ ↔ Lab) when relevant.
Reference
Quick format notes used by the converter.
- Hex:
#RRGGBBand#RRGGBBAAsupported (alpha optional). - RGB: accepts legacy
rgb(255, 128, 0)and modernrgb(255 128 0 / 0.8). - HSL/HSV: hue in degrees; saturation/lightness/value in percent.
- CMYK: percent-based output (0–100%).
- Lab: D65 reference white; output as
lab(L a b)numbers.
FAQ
Why do Hex and RGB sometimes not round-trip perfectly?
Conversions involving HSL/HSV/Lab can introduce rounding. This tool clamps values safely and rounds outputs for practical CSS use.
Is Lab “perceptually uniform”?
Lab is closer to perceptual uniformity than RGB/HSL, but it’s not perfect. It’s useful for comparing perceived differences.
Does this support Display-P3 or wide-gamut?
This tool targets sRGB for consistent web results. Wide-gamut handling can be added later if you want.
Will the URL change while I type?
No. URLs are generated only when you press “Share Link”.
Tool Info
Last updated:
Updates may include additional parsing tolerance, improved rounding, and export options.