How to Convert Colors Between HEX, RGB, and HSL
The same color has many names. `#3A7BD5`, `rgb(58, 123, 213)`, and `hsl(214, 63%, 53%)` all describe an identical blue — they are just different ways of writing it. Different tools and contexts want different formats, so converting between them is a routine design and development task. This guide explains what each format means, when to use which, and why HSL is secretly the most useful.
The three main formats
- HEX — `#RRGGBB`, two hex digits each for red, green, blue. The web default, compact, used everywhere in CSS.
- RGB — `rgb(r, g, b)`, the same channels as 0–255 numbers. Identical information, more readable, and `rgba()` adds transparency.
- HSL — `hsl(hue, saturation, lightness)`. A different way of thinking about color: hue is the shade (0–360° around the color wheel), saturation is how vivid, lightness is how bright.
How to convert colors with this tool
- Open the Color Converter tool.
- Enter a color in any format — HEX, RGB, or HSL.
- See it instantly translated into the others.
- Copy the format you need.
Everything runs in your browser — conversion is local and instant.
Why HSL is worth learning
HEX and RGB are precise but not intuitive — you cannot look at `#3A7BD5` and know how to make it slightly darker. HSL makes color *manipulation* obvious:
- Want it darker? Lower the lightness.
- Want it more muted? Lower the saturation.
- Want a matching color? Keep saturation and lightness, change the hue.
This is why HSL is the format of choice for generating color variations and building harmonious palettes. Design in HSL, convert to HEX for the stylesheet.
Transparency
RGB and HSL both have alpha variants — `rgba()` and `hsla()` — that add an opacity channel from 0 (invisible) to 1 (solid). HEX can encode alpha too, as a fourth pair of digits (`#3A7BD5CC`), though the numeric formats are clearer for it.
Related tools
To grab a starting color from an image rather than type one, Color Picker samples any pixel and gives you its code — then convert it here to every format. Building a design system? Sample a photo, convert to HSL, and generate a palette by shifting the values.
Common uses
- Translate a HEX code to RGB for a graphics program.
- Generate darker/lighter variants via HSL.
- Add transparency with rgba/hsla.
- Match colors across tools that want different formats.
Privacy and limits
Conversion is fully local — no upload, nothing stored, offline once loaded. Open the Color Converter tool to translate any color.
Try the tool
Open Color Converter →