Convert colors between HEX, RGB, and HSL formats instantly
Color conversion is the process of translating a color value from one format (HEX, RGB, HSL) to another, ensuring consistent color representation across design tools and code.
| Format | Best For |
|---|---|
| HEX | Compact notation, design tools |
| RGB | Readability, JavaScript |
| HSL | Color manipulation, themes |
| OKLCH | Perceptual uniformity |
Formula
HEX → RGB: R = HH₁₂, G = HH₃₄, B = HH₅₆ | RGB → HSL: L = (max + min) / 2, S = (max − min) / (1 − |2L − 1|), H = 60° × sectorHH₁₂ = First two hex digits converted from base-16 to 0–255
L = Lightness — average of the max and min RGB channel (0–1)
S = Saturation — spread of channel values relative to lightness
H = Hue — angular position on the color wheel (0°–360°)
Worked Example
Convert #F5C518 (IMDb yellow) to HSL
Did you know? HSL was designed to be more human-intuitive than RGB. You can create a full monochromatic palette by varying only the Lightness value while keeping Hue and Saturation fixed.
Sources
Convert text to ASCII codes and back. Supports decimal, hex, binary, and octal formats.
Convert width/height to aspect ratios, scale dimensions, and generate responsive embed CSS for any layout.
Calculate required internet bandwidth based on devices and activities in your household.
Encode and decode Base64 strings. Convert text for data URIs, APIs, and safe data transmission.
Create CSS border-radius with visual controls for each corner. Generate circles, pills, and custom shapes.
Create CSS box shadows with multiple layers, live preview, and copy-ready code.