Skip to content
AZ Tools

Color Format Converter

Convert any color between HEX, RGB, HSL, HSV, OKLCH, and a CSS custom property.

Preview
  • HEX#3B82F6
  • RGBrgb(59 130 246)
  • RGB (legacy)rgb(59, 130, 246)
  • HSLhsl(217 91% 60%)
  • HSVhsv(217, 76%, 96%)
  • OKLCHoklch(62.3% 0.188 259.8)
  • CSS var--color: #3B82F6;

How to use

  1. Use the color picker or paste a HEX value (3 or 6 digits, # optional).
  2. Every format updates instantly.
  3. Copy the format you need with the button on the right of each row.

About this tool

Show

Enter a colour once and read it back in every notation a stylesheet or a design tool might want — hex, rgb(), hsl(), hsv and oklch — each with its own copy button. The interesting one is oklch. Unlike HSL, whose lightness is a crude arithmetic mean, it is built on a perceptual model, so two colours with the same L look equally bright to the eye and changing the hue does not drag the brightness with it. That is what makes it the sane way to build a palette where every step actually reads as one step, and why it is increasingly used in modern CSS colour work. All the conversions run in the page as you type, and nothing you enter is uploaded.

Frequently asked questions

What is OKLCH?

OKLCH is a perceptually-uniform color space — equal numeric distances feel like equal visual distances. Modern CSS supports it natively and some design tools have started to support it for smoother gradients and consistent contrast.

Why two RGB rows?

Modern CSS uses space-separated 'rgb(59 130 246)'. Legacy CSS and older browsers expect comma-separated 'rgb(59, 130, 246)'. Both produce the same color.

What about alpha (RGBA / HSLA)?

This tool focuses on opaque colors. For transparency, append '/ 0.5' inside the modern syntax (e.g. 'rgb(59 130 246 / 0.5)') or use the legacy 'rgba(…, 0.5)' form.

Is HSV the same as HSB?

Yes — HSV (Value) and HSB (Brightness) are two names for the exact same color model. CSS doesn't accept hsv() directly; use HSL for stylesheets.

Guides on this topic

Related tools