Free online tools

HEX, RGB and HSL Color Converter

Paste a HEX, RGB or HSL color and get equivalent CSS formats. Preview the color on a checkerboard when it includes transparency.

Enter your values

Examples: #7a5, rgb(80 70 210 / 75%) or hsl(252deg 60% 52%).

This tool processes your input in your browser.

Result

Convert between CSS sRGB formats

Hex is a compact hexadecimal representation of red, green and blue. RGB writes the channels directly. HSL represents the same sRGB color using hue, saturation and lightness. HSL uses a 0-to-360 degree hue wheel.

Keep the transparency channel

An alpha of 0 is transparent and 1 is opaque. In eight-digit hex, alpha is stored in the last two digits, rounded to one of 256 byte values. A color copied as RGB or HSL can preserve more alpha precision.

Frequently asked questions

Can I paste legacy CSS color syntax?

Yes. The converter accepts space-separated functions and comma-separated rgb(), rgba(), hsl() and hsla() forms. Use a CSS color function or a hex code.

Can I convert Display P3 or CMYK colors?

This tool converts CSS sRGB colors among HEX, RGB and HSL. A different color space needs a separate color-space conversion.