EncryptCodecencryptcodec
Tools/Color Converter

Color Converter

Enter a color in any format — HEX, RGB, or HSL — and instantly convert it to all other formats.

All processing happens in your browser — nothing is sent to our servers

Color Formats Explained

HEX uses six hexadecimal digits to represent red, green, and blue channels (e.g. #FF5733). RGB expresses color as three decimal values from 0-255 for each channel. HSL describes color using Hue (0-360), Saturation (0-100%), and Lightness (0-100%) — often more intuitive for adjusting colors.

How it works
Color Format Conversion
HEX → RGB
01HEX input

#RRGGBB — each pair is a hexadecimal value (00–FF) representing a color channel intensity

02Parse pairs

Split into R, G, B pairs and convert each from hex to decimal (00 → 0, FF → 255)

03RGB output

rgb(R, G, B) — three decimal values from 0 to 255 representing red, green, and blue channels

RGB → HSL
01Normalize

R, G, B values divided by 255 to get values in [0, 1]

02Lightness

L = (max(R,G,B) + min(R,G,B)) / 2 — the midpoint of the brightest and darkest channels

03Saturation

S = (max - min) / (1 - |2L - 1|) — measures color intensity, 0 = gray, 1 = fully saturated

04Hue

H = angle on the color wheel (0–360°) — computed from which channel is dominant and the delta between channels

05HSL output

hsl(H, S%, L%) — hue in degrees, saturation and lightness as percentages

Spec: CSS Color Level 4 (W3C), sRGB color space

HSL is more intuitive for humans — adjust hue to change color, saturation for vibrancy, lightness for brightness. HEX/RGB are how computers store colors.

Frequently Asked Questions