Color converter
Convert a color between HEX, RGB and HSL.
Formula
HEX stores three 8-bit RGB channels; HSL describes hue, saturation and lightness of sRGB.
How to use
- Enter HEX, rgb(r, g, b) or hsl(h, s%, l%).
- Read the three color formats.
- Copy the codes and inspect the preview.
Examples
- #f00 = rgb(255, 0, 0) = hsl(0, 100%, 50%).
Frequently asked questions
Which HEX lengths work?
Three or six digits, with an optional #. Alpha transparency and named colors are not supported.
What ranges can I enter?
RGB uses integers 0–255. HSL uses degrees for hue and 0–100% for saturation and lightness.
Is HSL conversion exact?
HSL input is rounded to 8-bit RGB first. Output HSL uses up to four decimal places; gray has hue 0 by convention.
Sources
Updated: