Color Converter
Convert between HEX, RGB and HSL color formats
About Color Converter
Color formats are different notations for the same underlying data, but they are not equally convenient to work with. HEX is compact and universal; RGB maps to display hardware; HSL lets you intuitively adjust lightness and saturation; OKLCH adds perceptual uniformity so equal numeric steps produce equal-looking changes. This tool converts between all four, including alpha channels, so you can move freely between a designer's deliverables and your CSS codebase.
Common Use Cases
Frequently Asked Questions
What is the difference between HEX and RGB?
They carry identical information: red, green, and blue channel intensities from 0–255. HEX is just base-16 notation (#FF0000 = rgb(255, 0, 0)). Use whichever your context demands — CSS accepts both.
Why is HSL easier to manipulate than RGB?
RGB stores raw channel values that don't map intuitively to 'make this lighter' or 'shift the hue'. HSL separates hue (0–360°), saturation (0–100%), and lightness (0–100%), so you can tweak one dimension without recalculating the others.
What is OKLCH and why should I care?
OKLCH (OK Lightness, Chroma, Hue) is a perceptually uniform color space: a step of +10% lightness looks equally different regardless of the starting hue. HSL is not perceptually uniform — a yellow at 80% lightness looks much brighter than a blue at the same value. CSS Color Level 4 ships `oklch()` natively, and Tailwind v4 uses it internally.
How do alpha channels work across formats?
In CSS you can append a fourth component: `rgba(255, 0, 0, 0.5)`, `hsla(0, 100%, 50%, 0.5)`, or 8-digit hex `#FF000080` (last two hex digits = alpha 0–255). The alpha value is 0 (fully transparent) to 1 in CSS functions, or 0–255 in 8-digit hex.
What is sRGB, and does it cover all colors modern displays can show?
sRGB is the standard color space for the web and covers about 35% of visible colors. Modern displays (P3 wide gamut) can render roughly 50% of visible colors. CSS Color Level 4 lets you target P3 with `color(display-p3 r g b)`, but sRGB remains the safe default for cross-device consistency.