Color Converter
Type a color in any format — HEX, RGB, or HSL — and the other two update instantly alongside a live preview swatch. Everything runs locally in your browser.
Frequently asked questions
How do I convert HEX to RGB?
Split the six hex digits into three pairs and read each pair as a base-16 number from 0 to 255. For example #3b82f6 becomes rgb(59, 130, 246). Three-digit shorthand like #fff is expanded by doubling each digit first.
What do the numbers in HSL mean?
HSL stands for hue, saturation, lightness. Hue is an angle on the color wheel from 0 to 360 (0 is red, 120 is green, 240 is blue), saturation is the color intensity as a percentage, and lightness runs from 0% (black) to 100% (white).
Why might a round trip change a value by 1?
HSL values are rounded to whole numbers, so converting HSL back to RGB can differ from the original by a small rounding amount. HEX and RGB convert losslessly between each other.