Color Code Converter
Convert color codes between HEX, RGB, and HSL formats. Essential tool for web designers and developers.
HEX
—
RGB —
HSL —
How to Use This Calculator
- Select your input mode: HEX to RGB/HSL, or RGB to HEX/HSL.
- For HEX mode: select or enter a 6-digit hex code (without #).
- For RGB mode: expand "More options" and enter R, G, B values (0–255 each).
- All three color format equivalents are shown instantly.
Formula
HEX → RGB: R = hex pair 1, G = hex pair 2, B = hex pair 3 (in decimal)
RGB → HSL: complex formula involving max/min channels and ratios
Example
Example: #3498DB
→ rgb(52, 152, 219) → hsl(204, 70%, 53%)
Frequently Asked Questions
- A HEX color code is a 6-digit hexadecimal value representing the red, green, and blue channels (e.g. #FF5733). Each pair ranges from 00 (0) to FF (255).
- Split the 6-digit HEX into three 2-digit pairs and convert each from hex to decimal. For example, #FF5733 → R=255, G=87, B=51.
- HSL stands for Hue, Saturation, Lightness. Hue is a color angle (0–360°), saturation is color intensity (0–100%), and lightness is brightness (0–100%). It is more intuitive than RGB for color selection.
- They represent the same colors but in different notation. RGB uses decimal values rgb(255, 87, 51) while HEX uses hexadecimal #FF5733. Both are widely used in CSS.
- Pure red = #FF0000, pure green = #00FF00, pure blue = #0000FF. White = #FFFFFF, black = #000000.