Color Converter
Convert between HEX, RGB, and HSL color formats with live preview.
Utility
Color Converter
Generated on April 24, 2026
HEX
#3B82F6
RGB
rgb(59, 130, 246)
HSL
hsl(217, 91%, 60%)
Step-by-step calculation
Formula
HEX → split into RR/GG/BB pairs → parse each as base-16 → 0-255 RGB → HSL via min/max normalization.
- 1HEX = #3B82F6 → RR=3B, GG=82, BB=F6
- 2R = 0x3B = 59
- 3G = 0x82 = 130
- 4B = 0xF6 = 246
- 5Normalize to 0–1: (0.231, 0.510, 0.965)
- 6HSL: H = 217°, S = 91%, L = 60%
?What is the Color Converter?
A color converter moves colors between the three most common digital color formats: HEX (used for web CSS), RGB (used by screens and printers internally), and HSL (preferred by designers for its intuitive hue/saturation/lightness components). It includes a live color swatch preview so you can see exactly what each value represents. This tool is essential for web developers writing CSS, graphic designers moving between design and development tools, UX designers building color palettes, and anyone who has ever needed to translate a brand color from one format into another.
The Formula
HEX is simply a compact base-16 encoding of RGB values — each 8-bit channel (0–255) is written as a 2-digit hex code. HSL is a mathematical transformation of RGB: Hue represents the dominant color angle on a color wheel (0° = red, 120° = green, 240° = blue), Saturation is how pure vs gray the color is, and Lightness is how bright it is from black to white. HSL is usually easier for designers because shifting one slider produces intuitive results — changing saturation does not simultaneously affect brightness as it does in RGB.
Practical Examples
#FF0000 equals rgb(255, 0, 0) and hsl(0, 100%, 50%) — pure red, the zero-degree hue at full saturation and mid lightness.
#00FF00 equals rgb(0, 255, 0) and hsl(120, 100%, 50%) — pure green at 120° on the color wheel.
#3B82F6 equals rgb(59, 130, 246) and hsl(217, 91%, 60%) — the popular Tailwind CSS blue-500 color.
#000000 is black (rgb 0,0,0, lightness 0%); #FFFFFF is white (rgb 255,255,255, lightness 100%).
To darken a color for a hover effect, keep the same hue and reduce lightness by 10% — HSL makes this trivial.
Brand colors are often defined in HEX for web and PANTONE for print, with RGB and CMYK as intermediate conversions.