Color Converter
Convert colors between HEX, RGB, and HSL with a live preview
Converts a color between HEX, RGB, and HSL formats — edit any one of the three and the other two update instantly, with a live color swatch preview.
How it works
All three formats stay in sync through one shared RGB value: typing a valid HEX code, RGB triplet, or HSL triplet converts it to RGB internally and then re-derives the other two formats from that. Whichever field you're actively typing into is left alone while you type, so your keystrokes don't get overwritten mid-edit by its own round-trip conversion.
Frequently asked questions
What HEX formats does it accept?
Both 3-digit shorthand (like #06c) and full 6-digit HEX (like #0066cc), with or without the leading #, case-insensitive.
Why does typing in the RGB fields sometimes show an error?
Each RGB value has to be a whole number from 0 to 255 — a partial number while you're still typing, or a value outside that range, shows an inline error until you finish entering a valid value.
What ranges do the HSL fields accept?
Hue is 0 to 360 degrees, while saturation and lightness are both 0 to 100 percent. Values outside those ranges are rejected with an error rather than silently clamped.
Does editing HEX affect the RGB and HSL fields immediately?
Yes — as soon as you type a valid HEX value, the RGB and HSL fields (and the color swatch) update instantly to match, and the same is true in the other direction.
Is my color data sent anywhere?
No — every conversion is plain arithmetic that runs entirely in your browser. Nothing is uploaded.