Color Converter
Convert hex to RGB
What it does
One Field, Three Formats
Type #336699, rgb(51, 102, 153), or hsl(210, 50%, 40%) and see all of them at once.
Live Swatch
A preview of the color updates as you type, with its HEX value as the accessible label.
Strict Validation
Bad hex digits, RGB channels outside 0-255, and percentages outside 0-100 are rejected with a specific message.
Copy Each Format
Copy the HEX, RGB, or HSL value with its own button.
Frequently asked questions
Is anything uploaded?
No. Conversion runs in your browser. The page does download the code needed to run the tool.
Which inputs are accepted?
HEX with 3 or 6 digits (the # is optional), rgb() with 0 to 255 per channel, and hsl() with a hue in degrees and saturation and lightness from 0 to 100. Commas or spaces both work.
Why does HSL round-trip not always return my exact input?
RGB is whole numbers and HSL is shown rounded to whole degrees and percents, so some HSL values map to the same RGB color. HEX and RGB are always exact.
Is transparency (alpha) supported?
Not yet. #RRGGBBAA, rgba(), and hsla() are rejected with a clear message rather than silently dropping the alpha.