Colour format converter

Convert between HEX, RGB and HSL. Paste an opaque colour, preview the swatch and copy the format you need for CSS or design.

For example #7657C8, rgb(118, 87, 200) or hsl(256, 51%, 56%).

Converted values

HEX#7657C8
RGBrgb(118, 87, 200)
HSLhsl(256.46, 50.67%, 56.27%)

When to use HEX, RGB or HSL

Use HEX for compact design tokens, RGB when you need the red, green and blue channel values, and HSL when you want to adjust hue, saturation or lightness independently.

Paste a three- or six-digit HEX value, an rgb() value or an hsl() value. The swatch and all three outputs update as you edit. The conversion uses 8-bit sRGB channels and accepts opaque colours.

HSL is particularly handy when building hover, focus and muted states from a single brand colour: keep hue constant and nudge lightness up or down instead of guessing hex digits.

Common questions

Do HEX, RGB and HSL represent the exact same colours?

Yes. For opaque 8-bit sRGB colours, HEX, RGB and HSL are different notations for the same sRGB colour space, though rounding HSL percentages to whole integers can cause minor 1-unit differences when converting back.

Can I paste shorthand three-digit HEX codes?

Yes. Both three-digit shorthand codes such as #f50 and full six-digit codes such as #ff5500 are supported, with or without the leading hash symbol.