Skip to content
WebTricks

Color converter

Convert any color between HEX, RGB, HSL, HWB and OKLCH instantly. Paste any CSS color, copy the format you need.

hex#6b46ff
rgbrgb(107, 70, 255)
hslhsl(252, 100%, 63.73%)
hwbhwb(252 27.5% 0%)
oklchoklch(55.5% 0.2554 283.46)

About this color converter

This free color converter turns any CSS color into every common format at once. Paste a HEX, RGB, HSL, HWB, OKLCH value or a named color (like rebeccapurple) and instantly get the equivalent in all the others, ready to copy into your stylesheet. Everything is computed in your browser — no data is ever uploaded.

Why OKLCH matters

Alongside the classic formats it outputs OKLCH, the modern perceptually-uniform color space from CSS Color 4. OKLCH makes it far easier to build consistent palettes and smooth gradients than HSL, because equal numeric changes look like equal visual changes. Converting an old #rrggbb brand color to OKLCH is the first step to a modern, accessible color system.

How to use it

  1. Type or paste a color, or pick one with the swatch.
  2. Read the converted values for HEX, RGB, HSL, HWB and OKLCH.
  3. Click Copy next to the format you need.

Alpha (transparency) is preserved — an rgba() input round-trips to an 8-digit HEX and an oklch(... / a) value.

FAQ

Is HEX the same as RGB?

They describe the same sRGB color — HEX is just a compact notation.

Can I convert to OKLCH and back losslessly?

Conversions are exact within floating-point precision; tiny rounding can occur when a wide-gamut value is mapped back into sRGB hex.