Color Code Converter
Convert between HEX, RGB, and HSL color formats with auto-detection and a live preview.
About this tool
The Color Code Converter auto-detects whichever color format you paste in — HEX (#RRGGBB or the #RGB shorthand), rgb(r, g, b), or hsl(h, s%, l%) — and immediately shows the same color in all three formats, plus a matching CSS named color when there's an exact match against a curated list of common names.
HEX and RGB describe color as red/green/blue channel intensities. HSL (hue, saturation, lightness) describes the same color perceptually, which makes it far easier to reason about programmatically: "make this 10% darker" is a trivial HSL edit but an awkward RGB one. This tool implements the standard HSL↔RGB math directly, so you can go from a HEX value pulled off a live site straight to the HSL numbers you'd tweak in a CSS custom property.
Alongside the text input, a native browser color picker lets you pick a color visually and see it converted the same way. A live swatch shows the resolved color, and each output format has its own copy button.
