Color Converter

Convert colors between HEX, RGB, HSL and OKLCH with live preview and alpha support. Paste any CSS color or pick one visually.

Accepts HEX, rgb(), hsl() and oklch(), with or without alpha.

How to convert a color

  1. Type or paste a color in any supported format, or pick one with the color picker.
  2. The HEX, RGB, HSL and OKLCH values update instantly.
  3. Copy the format you need into your CSS, design tokens or code.

Color formats in CSS

Frequently asked questions

How do I convert HEX to RGB?

Split the six hex digits into three pairs and convert each pair from base 16 to base 10. For #FF8000, FF is 255, 80 is 128 and 00 is 0, so the color is rgb(255, 128, 0).

What is OKLCH and why use it?

OKLCH describes a color by perceived lightness, chroma (colorfulness) and hue. Unlike HSL, colors with the same lightness value really look equally light, which makes it much easier to build consistent palettes and accessible color scales. All modern browsers support it in CSS.

What does "outside the sRGB gamut" mean?

OKLCH can describe colors that ordinary sRGB screens cannot show. When that happens, the HEX, RGB and HSL values are clipped to the nearest displayable color.

Does it support transparency?

Yes. Use 8-digit HEX like #ff000080, or an alpha value in rgb(), hsl() or oklch(), for example rgb(255 0 0 / 50%). Alpha is kept in every output format.