Hex to RGB Converter

Convert between hex, RGB and HSL in either direction, nothing sent to a server.

Quick answer

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

  1. Paste a hex code, an rgb() value or an hsl() value into any field.
  2. The other formats update instantly below.
  3. Click Copy all to grab every format at once.
  4. 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

Yes, with no limits, no account and no sign-up.
No. The conversion runs as JavaScript in your browser, so nothing you enter is uploaded to a server.
They are two notations for the same colour. Hex is a base-16 shorthand like #1A2B3C, and RGB is the three decimal channel values from 0 to 255 that it decodes to. HSL describes the same colour as hue, saturation and lightness.
Yes. Eight-digit hex such as #1A2B3C80 and rgba() values are both accepted, and the alpha channel is carried through to the output.

Related tools

Further reading

📖 Understanding Color on the Web: Hex, RGB and HSL

Read the full guide on the 123MiniApps blog.

Pick a theme

Ten hand-tuned palettes.