Color Code Converter
Convert colors between HEX, RGB, and HSL formats instantly
Color Preview
🔄 Color Formats
About Color Converter
Convert a colour between HEX, RGB, HSL and related notations. They describe the same colour in different coordinate systems — which one you want depends on what you are about to do with it.
What each notation is good for
HEX is compact and the default in CSS and design tools. RGB names the same thing as three 0–255 channels, and is what image code works in. HSL splits colour into hue (0–360°), saturation and lightness — far easier to reason about when you want a variation, because you can hold the hue and move only lightness to build a consistent tint or shade.
#6366F1 is rgb(99, 102, 241) and hsl(239, 84%, 67%). To make a darker version for a hover state, drop the HSL lightness to about 57% — trying to do that by editing hex digits is guesswork.Why does the same hex look different on two screens?
Because a hex value is not an absolute colour until a colour space is attached to it. Most of the web assumes sRGB, but wide-gamut displays and phone colour modes render it differently, and uncalibrated monitors shift it further. For anything where the exact colour matters — brand assets, print — you need a defined profile, not a hex code alone.
What about alpha and the newer formats?
Adding transparency gives RGBA and HSLA, and eight-digit hex (#RRGGBBAA) does the same thing. Modern CSS also supports oklch(), which is designed so equal numeric steps look like equal visual steps — genuinely better for generating colour scales, and now supported in every current browser.
