Convert between HEX / RGB / HSL
This tool takes a six-digit hexadecimal color (HEX, such as #2F5D50), converts it to the two other common notations, RGB and HSL, and offers five suggested related colors. You can type the HEX value or choose a color with the system picker beside the field. Its boundaries are worth stating up front: HEX is the only accepted input, so you cannot enter RGB or HSL numbers and get HEX back; transparency (eight-digit HEX or rgba) is not supported; and three-digit shorthand such as #fff is rejected. It is a small converter, not a full palette builder or contrast checker.
Using the default #2F5D50, a deep teal-green, the tool actually computes rgb(47, 93, 80) and hsl(163, 33%, 27%). The five suggestions come out as: Complementary #5C2E3B (hue plus 180 degrees), Analogous 1 #2E525C (hue plus 30), Analogous 2 #2E5C38 (hue minus 30), Lighter #509F89 (lightness plus 20 points) and Darker #11221D (lightness minus 20 points, with a floor of 10%). The complementary and analogous colors keep the original saturation and lightness and only rotate the hue, while Lighter and Darker keep hue and saturation and change only the lightness. All of these values were produced by running the same conversion formulas the tool uses.
HEX is the usual notation in web pages and design files: compact and easy to copy. RGB uses three numbers from 0 to 255 for red, green and blue, matching how screens emit light, and is the input for many imaging libraries. HSL describes hue, saturation and lightness, which is closer to how people think about color: to make something lighter you raise l, whereas that is awkward to do directly in HEX. All three can be used directly in CSS.
The parser requires exactly six characters, two per channel. Three-digit shorthand simply doubles each digit, so #3a9 is the same as #33aa99. Expand it by hand and enter that.
Hue h is an angle from 0 to 360, where 0 is red, about 120 is green and about 240 is blue. Saturation s and lightness l each run from 0% to 100%. Lightness 0% is black and 100% is white; saturation 0% is gray. In the example, 163 degrees lies between green and cyan, which is why the color reads as teal-green.
Yes. The RGB row is written as rgb(47, 93, 80) and the HSL row as hsl(163, 33%, 27%), both valid CSS. The HEX row includes # only if you typed one, so check that first.
Every conversion is calculated in your browser by the code on this page. The colors you type or pick are not sent to a server and nothing is stored. The color picker is a control supplied by your browser or operating system and its look varies by platform, but it does not send your selection to this site.