Skip to content

Web

CSS color converter

Enter a HEX colour to see its RGB and HSL CSS equivalents.

HEX

#2563eb

RGB

rgb(37, 99, 235)

HSL

hsl(221 83% 53%)

Converts opaque HEX colours to CSS RGB and HSL. Alpha channels and colour-profile conversions are not included. Conversion stays in your browser.

Worked example

Reuse a HEX colour in a different CSS format.

Example input

#ff0000

Expected result

rgb(255, 0, 0) and hsl(0 100% 50%) describe the same opaque red.

Before using your result

The converter accepts 3- or 6-digit HEX. It does not handle alpha transparency or colour profiles.

How this works

Enter a 3-digit or 6-digit HEX colour. The tool expands shorthand HEX and calculates RGB and HSL values.

The swatch previews an opaque colour. Alpha channels and colour profiles are outside this tool's scope.

Opaque sRGB-style values only; HSL values are rounded for display.

Questions

Does #abc work?+

Yes. Three-digit HEX shorthand expands to six digits before conversion.

Are alpha values supported?+

No. The converter handles opaque colours only.

Can I copy each format?+

Yes. Each displayed value has a copy button.