Hex to RGB Converter
Convert between hex, RGB and HSL in either direction, nothing sent to a server.
Convert colours between hex, RGB and HSL in either direction. Paste a hex code, an rgb() or an hsl() value and get all three formats at once, in your browser.
Paste a hex, RGB or HSL value into any field.
Features
- Converts hex to RGB, RGB to hex, and both to HSL
- Auto-detects the format you type, no dropdown needed
- Accepts shorthand hex (#fff) and 8-digit hex with alpha
- One-click copy for every output format
- Live swatch preview and a native colour picker
How to use it
- Paste a hex code, an rgb() value or an hsl() value into any field.
- The other formats update instantly below.
- Click Copy all to grab every format at once.
- Use the swatch to confirm the colour before copying.
Why hex, RGB and HSL all exist
A hex to RGB conversion is really just a change of notation for the same colour. Hex is a compact base-16 shorthand that design tools and CSS favour, while RGB is the three decimal channel values from 0 to 255 that a screen actually uses to light each pixel. Converting hex to RGB, or RGB to hex, is lossless: #1A2B3C and rgb(26, 43, 60) are the identical colour written two ways.
HSL describes that same colour as hue, saturation and lightness, which is far easier for a human to reason about when you want a slightly lighter or more muted version without guessing at channel values. That is why this converter shows all three at once: you pick whichever notation is convenient and read off the others.
Eight-digit hex and rgba() add an alpha channel for transparency, and both are accepted here. The conversion runs entirely in your browser, so nothing you paste is ever sent to a server.
Frequently asked questions
Related tools
Further reading
Read the full guide on the 123MiniApps blog.