Color format converter
Convert between HEX / RGB / HSL with a live preview
Enter a HEX, rgb() or hsl() color to preview and convert it. Alpha appears in output formats that support transparency.
| HEX | ||
|---|---|---|
| RGB | ||
| HSL |
Example
Input
#ff000080
Example result
rgba(255, 0, 0, 0.502) hsla(0.0, 100.0%, 50.0%, 0.502)
Hex 80 equals 128, so alpha is 128/255, slightly above 0.5.
Technical details & limits
RGB channels use 0–255; HSL hue wraps around 360 degrees with percentage saturation and lightness. Hex alpha comes last, unlike ARGB, and conversion to eight-bit alpha rounds values. This is an sRGB converter, not a CMYK, ICC color-management or WCAG contrast tool.
About this tool
Convert colors between HEX, RGB/RGBA and HSL/HSLA with a live swatch. Compare design values, adjust CSS colors and inspect alpha using common short and alpha-bearing hex formats.
Use cases
- The design ships HSL and the frontend wants HEX or RGBA.
- Rewrite CSS custom properties into a different format en masse.
- Sanity-check what a color actually looks like from the code.
Notes
Color-space conversion rounds; a round trip can shift a channel by 1. HSL hue is normalised to 0–360°.
FAQ
- Are `#f00` and `#ff0000` the same?
- Yes. `#RGB` expands to `#RRGGBB` by doubling each digit.
- Does HSLA accept a percentage alpha?
- Yes — 0-1 decimals or 0%-100%.
- Why do values change slightly after repeated conversions?
- RGB and hex alpha use discrete integers, and displayed HSL has limited decimal places. Round trips can introduce rounding; keep original design values as the reference.
- Does the preview show the final color on every background?
- No. Translucent colors blend with their background. The same RGBA value can look different on different backgrounds; check it on the intended page.