What is the difference between HEX, RGB, and HSL?
They are three ways to write one color. HEX and RGB both mix red, green, and blue, while HSL uses hue, saturation, and lightness, which makes it easier to reason about lighter and darker shades.
Click the palette icon to open system color picker.
Runs in your browser. No signup required.
Pick a color and get its code in three common formats at once: HEX, RGB, and HSL. Use it to match a color from a design, to find the RGB values behind a hex code, or to copy a value straight into a stylesheet.
Everything updates as you choose or type, and each format has its own copy button. Nothing is uploaded.
Pick or type a color, then copy the format you need.
Click the palette icon next to the Color Picker label to open your device's color chooser, and pick a color.
Or type a code into the HEX box, such as #0ea5e9 or the short form #fff.
Check the large swatch and the three cards underneath: HEX, RGB, and HSL.
Press Copy HEX, Copy RGB, or Copy HSL to copy that value.
Input: #0ea5e9
Result: rgb(14, 165, 233) and hsl(199 89% 48%)
Input: #fff
Result: rgb(255, 255, 255) and hsl(0 0% 100%)
Input: #808080
Result: rgb(128, 128, 128) and hsl(0 0% 50%)
Input: #ff8000
Result: rgb(255, 128, 0) and hsl(30 100% 50%)
ff is 255, 80 is 128, and 00 is 0, which is how the three pairs turn into RGB numbers.
Input: #ff0000
Result: rgb(255, 0, 0) and hsl(0 100% 50%)
A HEX code packs red, green, and blue into three pairs of digits, each from 00 to FF, which is 0 to 255. In #0ea5e9 the pairs are 0e, a5, and e9, giving red 14, green 165, and blue 233. A three-digit code doubles each digit, so #fff means #ffffff.
HSL describes the same color by hue, saturation, and lightness. Hue is an angle on the color wheel from 0 to 360, saturation runs from grey to vivid, and lightness runs from black to white. The tool works these out from the RGB values and rounds them to whole numbers.
They are three ways to write one color. HEX and RGB both mix red, green, and blue, while HSL uses hue, saturation, and lightness, which makes it easier to reason about lighter and darker shades.
No. You can use the picker or a HEX code. The RGB and HSL cards show results for you to copy.
The HEX box holds text that is not a valid color code, so the cards fall back to black. Fix the code and they update.
It is written in the modern style, such as hsl(199 89% 48%). RGB keeps its commas.
Yes. Paste the HEX, RGB, or HSL value anywhere a color is accepted, such as a stylesheet, a design tool, or a slide deck.
The palette icon opens whatever chooser your browser or device provides, so its look varies. Typing a code in the HEX box works the same everywhere.
No. The tool works on this page and keeps nothing.