Skip to main content

CSS Color Converter

Convert colors between HEX, RGB, and HSL formats.
Enter any color and get all format conversions instantly.

Converted Formats
RGB
rgb(59, 130, 246)
HSL
hsl(217, 91%, 60%)
RGB Values
59, 130, 246
HSL Values
217, 91%, 60%
CSS Variable
--color: #3b82f6;
Red
59
Green
130
Blue
246
Hue
217deg
Saturation
91%
Lightness
60%

Color Format Conversions

HEX to RGB

Convert hexadecimal color codes (#RRGGBB) to RGB values (0-255).

#3b82f6 = rgb(59, 130, 246)

RGB to HSL

Convert RGB values to Hue, Saturation, and Lightness.

rgb(59, 130, 246) = hsl(217, 91%, 60%)

HSL to HEX

Convert HSL values back to hexadecimal format.

hsl(217, 91%, 60%) = #3b82f6

Understanding Color Formats

HEX

Hexadecimal color codes use 6 characters (0-9, A-F) to represent RGB values. Each pair represents a value from 0-255. Format: #RRGGBB

RGB

RGB uses decimal values (0-255) for Red, Green, and Blue channels. Format: rgb(R, G, B)

HSL

HSL represents colors using Hue (0-360 degrees), Saturation (0-100%), and Lightness (0-100%). More intuitive for color adjustments. Format: hsl(H, S%, L%)