Color Converter
Convert colors between HEX, RGB, and HSL — enter a value in any format and see the others update instantly.
How to use this tool
Type a color into any of the three fields (HEX like #5b6cff, RGB like rgb(91, 108, 255), or HSL like hsl(234, 100%, 68%)) and the other two update automatically, along with the preview swatch.
About these conversions
HEX and RGB describe the exact same value in different notations (base-16 vs. base-10 per channel) and convert without any loss. HSL uses the standard formula to derive hue, saturation, and lightness from RGB, and the inverse to go back — converting HSL (rounded to whole numbers for display) back to RGB can shift a channel by ±1 out of 255, which is expected rounding noise, not a bug.
Frequently asked questions
What's the difference between RGB and HSL?
RGB describes a color by the intensity of red, green, and blue light (0-255 each). HSL describes the same color space differently — hue (the color's position on a 0-360° color wheel), saturation (how vivid vs. gray), and lightness (how light vs. dark) — which many designers find more intuitive for adjusting a color.
Why might converting back and forth change the value slightly?
HSL values are commonly displayed as whole-number degrees and percentages, which rounds the underlying floating-point numbers. Converting HSL back to RGB after that rounding can shift a color channel by 1 out of 255 — invisible to the eye and not a bug.