Color Converter
Convert between HEX, RGB and HSL. Type in any field — everything updates live, with a preview swatch.
How to use
- Type a hex color (#4F46E5 or 4F46E5) — RGB and HSL update instantly, and the swatch shows the color.
- Or type RGB / HSL values directly; every other format follows in real time.
- Copy CSS values puts all three formats on your clipboard, ready to paste into CSS.
Frequently asked questions
How do I convert HEX to RGB?
A hex color like #4F46E5 splits into three pairs: 4F, 46 and E5. Convert each pair from hexadecimal to decimal — 4F is 79, 46 is 70, E5 is 229 — giving rgb(79, 70, 229). This tool does the conversion live as you type.
What is the difference between RGB and HSL?
RGB describes which amounts of red, green and blue light are mixed. HSL describes the same color the way humans think: hue (position on the color wheel, 0-360 degrees), saturation (intensity, 0-100%) and lightness (0-100%). HSL is far more intuitive for generating color palettes.
What does an 8-digit hex color mean?
The extra two digits are alpha (opacity) in the same 00-FF range: #4F46E5FF is fully opaque, #4F46E580 is roughly 50% transparent. Browsers support both 6-digit and 8-digit hex in CSS.