Three ways of writing the exact same color, and why picking the right one makes adjusting colors in CSS much easier.
#2E42FF, rgb(46, 66, 255), and hsl(234, 100%, 59%) are the exact same shade of blue, written three different ways. CSS accepts all three, so the choice usually comes down to which one is easiest to work with for what you're doing.
HEX codes pack red, green, and blue into a six-character string like #2E42FF — two characters per channel, in base 16. They're compact and universally supported, which is why they're the default format in most design tools and style guides. The tradeoff is that HEX isn't intuitive to read — you can't easily tell how bright or saturated a color is just by looking at the code.
RGB writes the same three channels as plain numbers from 0-255, like rgb(46, 66, 255). It's the same underlying color as the HEX version above, just formatted differently. RGB (and its variant RGBA, which adds transparency) is useful when you're adjusting a color programmatically, since the numbers are easier to reason about than hex pairs.
HSL describes a color by hue (its position on a color wheel, 0-360), saturation (how vivid it is, as a percentage), and lightness (how light or dark it is, as a percentage). This maps much more closely to how people actually describe color — "a slightly darker version of this blue" is just lowering the lightness value, something that's much harder to do by eye with HEX or RGB.
You don't need to do this math by hand. The Color Converter converts between HEX, RGB, HSL, HSV, and CMYK instantly, and the dedicated HEX to RGB and RGB to HEX tools handle the two most common conversions directly. If you just want to explore a color visually first, the Color Picker shows every format for whatever color you select.
If you're building a color palette with consistent lightness steps — like a set of button hover states — HSL makes that far easier than adjusting HEX codes by trial and error.
Convert colors between HEX, RGB, RGBA, HSL, and HSV with a live preview.
Convert a HEX color code to its RGB and CSS rgb() values.
Convert RGB red, green, and blue values to a HEX color code.
Pick a color and instantly see HEX, RGB, HSL, HSB, CMYK, and CSS values.
No — they're three different ways of writing the exact same color. Converting between them doesn't change the actual color, only how it's represented.
Any of them work in modern CSS. HEX is the most common default; HSL is often easier when you need to programmatically lighten or darken a color.
It's the alpha channel, controlling transparency, from 0 (fully transparent) to 1 (fully opaque).
You don't need a trained eye to pick colors that work together. You need to know a handful of relationships on the color wheel.
Three terms designers use constantly and mix up just as often. Here's the precise difference, with a clear way to remember it.
Two nice colors and a straight blend between them can still come out looking gray and lifeless in the middle. Here's why, and the fix.
Turning one color you like into a full, working set — text, background, accents, and everything that needs to pair with it.