Color converter
Convert HEX, RGB and HSL, preserve alpha and preview the color.
Get started
- Use the example values or enter your own measurements.
- Calculate, then copy the result or download the available details.
Example
Input
rgb(102, 51, 153)Expected result
#663399, hsl(270 50% 40%)Good to know
The calculation runs in your browser. Use consistent units in fields with no explicit unit.
Calculation method
HEX represents 8-bit channels. RGB accepts numbers or percentages. HSL uses degrees for hue and percentages for saturation and lightness. HEX output rounds channels to the nearest byte.