Skip to content
Devtoolry

Color Converter

Convert colours online between HEX, RGB, HSL and CSS formats with a live preview. Pick a colour or paste a HEX, RGB or HSL value to get every format.

Runs in your browser · Nothing uploadedFree · No sign-up

Something not working, or missing a feature? Send feedback

About the Color Converter

The Color Converter translates colours between HEX, RGB, HSL and CSS notations with a live swatch, which is handy when design tokens, CSS and design tools use different formats.

Conversion happens in your browser, so your files and records stay private.

How to use the Color Converter

  1. Enter a colour in any format or pick one.
  2. Read the equivalent HEX, RGB and HSL values.
  3. Copy the format you need.

Example

Convert a brand blue

Input

#2563eb

Result

HEX  #2563eb
RGB  rgb(37, 99, 235)
HSL  hsl(221, 83%, 53%)

With rgba(37, 99, 235, 0.5) as input, the alpha carries over: #2563eb80, rgba(37, 99, 235, 0.5) and hsla(221, 83%, 53%, 0.5).

Common mistakes

  • Rounding in HSL. HSL values are rounded to whole numbers, so converting HSL back to HEX can differ by one in a channel. Keep the HEX or RGB value as the source of truth.
  • Low contrast text. A colour that looks fine as a swatch may be unreadable as text. Aim for a contrast ratio of at least 4.5:1 against the background for body text (WCAG AA).
  • Colour names and modern formats. Names such as rebeccapurple and newer formats such as oklch() are not parsed. Enter HEX, RGB or HSL.

Works well with the Color Converter

Frequently asked questions

Why use HSL?

HSL makes it easy to create lighter, darker or less saturated variants of the same hue by changing one number.

Are transparent colours supported?

Alpha values are supported in RGBA, HSLA and 8-digit HEX.

What is 8-digit HEX?

The last two digits are the alpha channel: #2563eb80 is the same blue at 50% opacity. All current browsers support it in CSS.

Is RGB or HSL better in CSS?

They describe the same colours. HSL is easier to adjust by hand (lighter, darker, less saturated); RGB and HEX match what design tools export.

Guides and tutorials