If you have ever worked with colors online, you have probably seen codes like #6C5CE7, rgb(108, 92, 231), or hsl(247, 72%, 63%). They all describe the same color — but in very different languages.

This guide explains what each format means, in plain terms, so you can use them with confidence.

HEX: The web color shorthand

HEX (short for hexadecimal) is the most common format for colors on the web. It looks like this:

HEX
#6C5CE7
A 6-digit code starting with #. Each pair of digits represents the Red, Green, and Blue value of the color (in that order).

HEX is compact and easy to copy. It is the default format most design tools show when you select a color. The # symbol simply tells the browser it is a HEX color.

RGB: The color of light

RGB stands for Red, Green, Blue. It describes a color by telling exactly how much red, green, and blue light to mix together.

RGB
rgb(108, 92, 231)
Three numbers from 0 to 255. The first is Red, second is Green, third is Blue. 0 means none of that color; 255 means full intensity.

RGB comes from the world of screens and light. If you have ever mixed paint, think of it differently: adding more of each color makes the result brighter, not darker. Pure white is rgb(255, 255, 255) — all lights at full. Pure black is rgb(0, 0, 0) — all lights off.

[Ad placement — mid article]

HSL: The color of the human eye

HSL stands for Hue, Saturation, Lightness. This format was designed to match how humans naturally think about color.

HSL
hsl(247, 72%, 63%)
Three values: Hue (0-360 degrees on a color wheel), Saturation (0-100%, how vivid or gray the color is), Lightness (0-100%, how light or dark the color is).

HSL is the easiest format to adjust by hand. Want a lighter version of a color? Increase the last number. Want a more muted tone? Decrease the middle number. It maps directly to the words designers and artists use every day.

When to use which format

They are all the same color

Here is the same purple shown in all three formats:

The same color
#6C5CE7  ·  rgb(108, 92, 231)  ·  hsl(247, 72%, 63%)
All three describe exactly the same color, just written differently. Choose whichever format is most convenient for your workflow.

Quick conversion tools

PhotoColor provides free tools to convert between all three formats instantly. No math required — just enter a color value and get the equivalent in the other formats.

HEX to RGB
Convert HEX to RGB instantly
RGB to HEX
Convert RGB to HEX instantly