DexTools

Colour Converter

Convert a colour between HEX, RGB and HSL, with a live swatch and the readable text colour for that background.

Nothing leaves your browser Dex Media & Design

Colour

Formats

#1d4ed8
HEX
#1d4ed8
RGB
rgb(29, 78, 216)
HSL
hsl(224, 76%, 48%)
HSL values
h 224°, s 76%, l 48%
Luminance
0.1067
Readable text
#ffffff
Save to DriveInsert into Office

Saving needs a Dex account. The tool never does.

How it works

  • Type a HEX value or pick a colour. Every representation appears at once: HEX, RGB, HSL, the individual HSL components and the relative luminance.
  • The swatch is rendered at the size you will actually use, with the readable text colour calculated from the contrast ratio rather than guessed.
  • Shorthand HEX such as #1d4 is expanded before conversion, and rgb() input is accepted as well as HEX.
  • The conversion is arithmetic in the page. No colour library, no request, no palette upload.

Examples

Getting an HSL value for a theme

A designer hands over a HEX brand colour; the theme wants HSL so the lightness can be varied. Pick the colour and copy the HSL line.

Checking a colour from a screenshot

Paste the sampled HEX and read the readable text colour: it tells you immediately whether black or white type will survive on that background.

Frequently asked questions

Why do the HSL numbers look rounded?

Hue is shown in whole degrees and saturation and lightness in whole percent, which is what CSS authors expect. The underlying conversion is exact and the RGB line keeps full precision.

What does relative luminance mean?

The WCAG measure of how much light a colour emits, from 0 for black to 1 for white. It is the input to the contrast ratio used for accessibility thresholds.

Does it support alpha?

HEX is read as six digits, or three for shorthand. Alpha is ignored because the formats shown are for solid colours; use the contrast checker for overlay decisions.

Is anything uploaded?

No. The conversion is arithmetic in the page; the colour you type is never transmitted or stored.