Nothing you open here is ever uploaded

Convert a colour between HEX, RGB and HSL

Paste a colour in any of the usual notations and get the other two. Three-digit shorthand is expanded by doubling each digit, which is what CSS does: #abc is #aabbcc, not #0a0b0c. Getting that wrong turns a light colour into a nearly black one, and since both are valid colours nothing complains. Unreadable input is named rather than silently treated as black.

This page loads no libraries at all — the work is done by the browser itself. Your file is read on your own machine and never sent anywhere — open your browser's network tab and watch while you use it.

Questions

How is #abc expanded?

Each digit is doubled: #abc becomes #aabbcc. The other reading — padding each digit with a leading zero — gives #0a0b0c, which is almost black. Both are valid colours and neither the browser nor the eye will tell you which one you got until the design looks wrong.

Which notations are accepted?

Six-digit hex, three-digit hex, with or without the hash, and rgb() or rgba() with commas or spaces. The alpha value is read and ignored, since HEX and HSL as printed here describe the colour rather than its transparency.

Why does HSL sometimes not round-trip exactly?

Because HSL is stored as whole degrees and percentages here, and that is coarser than the 256 levels per channel that hex holds. Converting back can land a shade away. The hex and rgb values are exact; treat the HSL as the one for reasoning about hue and lightness rather than as a lossless copy.

What happens with a name like "blue"?

It is refused, with a message saying what is accepted. Named colours would need the full CSS list, and quietly falling back to black — which is what an unparsed colour usually becomes — would be a wrong answer dressed as a right one.

Other images tools

Everything here is free and works the same way — in your browser.