Conversion
Color Converter
Convert colors between HEX, RGB, HSL, and HSV formats. Live preview included. Copy any format with one click.
Input Format
RGB Values
HSL Values
Enter a color value and click Convert
HEX
RGB
HSL
HSV
How is this calculated?
Formula: Standard color space conversion algorithms.
HEX → RGB:
R = parseInt(hex[1..2], 16)
G = parseInt(hex[3..4], 16)
B = parseInt(hex[5..6], 16)
RGB → HSL:
r, g, b = R/255, G/255, B/255
max = max(r,g,b), min = min(r,g,b)
L = (max + min) / 2
S = (max - min) / (1 - |2L - 1|)
H = based on which channel is max
RGB → HSV:
V = max(r,g,b)
S = (max - min) / max
H = same as HSL hue calculation Conversion history
No conversions yet.
FAQ
Frequently asked questions
What is the difference between HEX, RGB, and HSL color formats?
HEX uses a 6-digit hexadecimal code (#RRGGBB) commonly used in web development. RGB defines colors by Red, Green, Blue intensity (0–255 each). HSL uses Hue (0–360°), Saturation (0–100%), and Lightness (0–100%), which is more intuitive for color manipulation — adjusting lightness makes colors lighter/darker, adjusting saturation makes them more/less vivid.
Why do designers prefer HSL over RGB?
HSL is more intuitive for human perception. To make a color lighter, increase L. To desaturate, decrease S. To shift the hue, change H. In RGB, achieving similar effects requires adjusting all three channels simultaneously. HSL makes it easy to create color palettes — keep H constant and vary S and L for harmonious shades.
How do I convert HEX to RGB manually?
Split the 6-digit hex code into 3 pairs (RR, GG, BB). Convert each pair from hexadecimal to decimal. For example, #2563EB: 25₁₆ = 37, 63₁₆ = 99, EB₁₆ = 235. So RGB is (37, 99, 235). Each hex digit represents 0-15, and each pair ranges from 00 (0) to FF (255).
What is HSV and how does it differ from HSL?
HSV (Hue, Saturation, Value) is similar to HSL but uses "Value" (brightness) instead of "Lightness." In HSV, S=100% V=100% gives the pure hue. In HSL, S=100% L=50% gives the pure hue. HSV is common in color pickers (like Photoshop), while HSL is more common in CSS. Both represent the same colors but organize them differently.
Can all RGB colors be represented in HEX and vice versa?
Yes, HEX and RGB represent the exact same color space (sRGB with 16.7 million colors). Every RGB value has a unique HEX equivalent and vice versa. HSL also covers the same gamut but may have minor rounding differences when converting. All three are lossless representations of the same 24-bit color space.