Color Converter

Convert between HEX, Red Green Blue (RGB), and Hue Saturation Lightness (HSL) color notations with a preview swatch.

HEX to RGB: the calculation

A HEX color is three bytes: red, green and blue, each written as two hexadecimal digits.

#FF5733

FF = 15 × 16 + 15 = 255   red
57 =  5 × 16 +  7 =  87   green
33 =  3 × 16 +  3 =  51   blue

rgb(255, 87, 51)   =   hsl(11, 100%, 60%)

More reference values:

#000000   rgb(0, 0, 0)         hsl(0, 0%, 0%)       black
#FFFFFF   rgb(255, 255, 255)   hsl(0, 0%, 100%)     white
#808080   rgb(128, 128, 128)   hsl(0, 0%, 50%)      mid grey
#3B82F6   rgb(59, 130, 246)    hsl(217, 91%, 60%)   blue

The short form doubles each digit: #F53 is #FF5533.

What the three HSL numbers mean

  • Hue is an angle on the color wheel: 0 is red, 120 is green, 240 is blue. Adding 180 gives the complementary color.
  • Saturation runs from 0 % (grey) to 100 % (the pure color).
  • Lightness runs from 0 % (black) through 50 % (the pure color) to 100 % (white).

HSL is the practical notation for building a palette: keep the hue, and change only the lightness to get the hover, border and background variants of one color. In RGB the same step changes all three numbers.

Equal lightness in HSL does not mean equal brightness to the eye. Yellow at 50 % lightness looks much brighter than blue at 50 %. Check text contrast with a contrast ratio, not with the HSL lightness value.

An eight-digit HEX code carries transparency in its last two digits: #FF573380 is the same color at 50 % opacity.

Related tools

Monitor Color Converter automatically

Convert between HEX, Red Green Blue (RGB), and Hue Saturation Lightness (HSL) color notations with a preview swatch. NetTests can run this check on a schedule, preserve historical results, compare changes over time, and alert you the moment something breaks.

Start monitoring free → See all monitoring products

Frequently Asked Questions

What color notations does this tool convert between?

HEX — #FF5733 (web standard, used in HyperText Markup Language (HTML)/Cascading Style Sheets (CSS)). RGB (Red Green Blue) — rgb(255, 87, 51) (red, green, blue, each 0–255). HSL (Hue Saturation Lightness) — hsl(11, 100%, 60%) (hue 0–360°, saturation %, lightness %). HSL is more intuitive for humans — adjusting lightness and saturation doesn't require recalculating all three channels.

When should I use HSL instead of RGB?

Hue Saturation Lightness (HSL) is ideal when you want to generate color variations — lighter/darker shades, more/less saturated versions — by adjusting a single value. Rotating the hue by 30° gives a harmonious analogous color; rotating 180° gives the complement. Cascading Style Sheets (CSS) design systems (like Tailwind's color palette) are often defined in HSL for this flexibility.

What is the difference between HEX 3-digit and 6-digit notation?

3-digit HEX (#F53) is shorthand where each digit is doubled: #FF5533. It only works when both digits of each channel are the same. 6-digit is universal. The 8-digit form (#FF5733CC) adds an alpha channel (CC = 80% opacity), supported in modern browsers via Cascading Style Sheets (CSS) Color Level 4.