Color Picker

Cmd/Ctrl+Enter saves this color to history.

HEX

#3b82f6

RGB

rgb(59, 130, 246)

HSL

hsl(217, 91%, 60%)
Advertisement

Convert a color between HEX, RGB, and HSL with a live swatch preview. Shorthand hex (#f00) is expanded automatically, and every channel is clamped to its valid range (0–255 for RGB, 0–100% for HSL saturation/lightness) so an out-of-range value can't produce an invalid color.

Frequently asked questions

Does it accept shorthand hex like #f00?
Yes — 3-digit shorthand is expanded to 6 digits (#f00 becomes #ff0000) before conversion.
Why does converting HSL back to RGB give a slightly different value?
RGB↔HSL conversion involves rounding at each step (HSL components are rounded to whole-number degrees/percentages), so a round-trip can shift by 1 in a channel. This matches how browsers and most color tools round HSL, not a bug specific to this converter.
What happens if I enter an invalid hex code?
It's rejected with an explicit error — hex input must be exactly 3 or 6 valid hex digits, optionally prefixed with #.
Is my input uploaded anywhere?
No. Conversion happens locally in your browser tab — nothing is sent to a server.

Read the full guide for this tool →

Advertisement