Color Converter

Paste any CSS color and get every format at once: HEX, RGB(A), HSL(A), HWB, LAB, LCH, OKLAB, OKLCH, and color(). Alpha and gamut-aware. Converted in your browser, never sent.

Loading…
Color Converter
Paste HEX, RGB(A), HSL(A), HWB, LAB, LCH, OKLAB, OKLCH, CSS color(), or a named CSS color and get every other format at once. Alpha and gamut-aware, with a shareable URL.

Developer notes

colorjs.io is the sole parser/converter: no chroma-js, tinycolor2, or culori. Alpha multiplies the pasted color's own alpha, so a pasted rgba(...) keeps its alpha at the default alphaValue=1. HWB and the LAB/LCH/OKLAB/OKLCH/color() block never carry an alpha suffix. Only rgba, hsla, hex8, and color() reflect alphaValue. Out-of-gamut colors use the CSS Color 4 gamut-mapping algorithm when gamutFallback is on; off shows a naive per-channel clip. Precision rounds LAB/LCH/OKLAB/OKLCH/color() channels only. HEX/RGB/HSL are fixed by definition.

Options

  • Alpha — Multiplies the pasted color's own alpha. Recomputes rgba, hsla, hex8, and color() alpha; hex6 and plain HSL stay unaffected. Default 1 (preserves the pasted alpha).
  • Modern formats — Shows or hides the LAB / LCH / OKLAB / OKLCH / color() block. HEX/RGB(A)/HSL(A)/HWB always stay visible. Default on.
  • Gamut fallback — Shows a visible badge and a gamut-mapped sRGB value for wide-gamut input. Off shows only the raw, possibly clipped values. Default on.
  • Precision — Decimal places shown on LAB/LCH/OKLAB/OKLCH/color() numeric channels. Does not apply to HEX, which has fixed digits, or to RGB/HSL, which use integers and percentages. Default 2.

Related CSS tools

Hub: Color & CSS Tools. Check contrast with Color Contrast Checker, or shrink and format stylesheets with Minify CSS and Beautify CSS.

Color Converter FAQ

Local universal color converter

What color formats can I paste?

HEX, RGB(A), HSL(A), HWB, LAB, LCH, OKLAB, OKLCH, CSS color() including display-p3, and named CSS colors. No format picker is needed.

Are my colors uploaded anywhere?

No. Parsing and conversion run entirely in your browser via colorjs.io. FastMinify never sends colors to a server.

What happens to out-of-gamut colors?

A badge appears. With gamutFallback on, the HEX/RGB/HSL rows show an sRGB value mapped by CSS Color 4. It is labeled apart from the raw wide-gamut value in the modern block.

Does alpha apply to every format?

Alpha reflects in rgba, hsla, hex8, and color(). HWB and the LAB/LCH/OKLAB/OKLCH channels stay alpha-free.

Paste-local WCAG contrast checking with modern CSS color syntax — pair and matrix views, never uploaded.