Hex to RGB Converter
Convert a hex colour to RGB and HSL with a live swatch and a shades strip. Accepts 3- or 6-digit hex, with or without the #.
Convert a hex colour to RGB and HSL with a live swatch and a shades strip. Accepts 3- or 6-digit hex, with or without the #.
A hex colour is just three pairs of hexadecimal digits — one each for red, green and blue. To convert hex to RGB, split the code into those pairs and read each as a number from 0 to 255. For #2563EB that is 25 → 37 (red), 63 → 99 (green) and EB → 235 (blue), giving rgb(37, 99, 235). This converter does it as you type and shows a live swatch, the matching HSL value, and the individual R, G and B channels.
Short three-digit hex codes work too: each digit is doubled, so #F0A is the same as #FF00AA. The leading # is optional — paste with or without it.
| Hex | RGB | Name |
|---|---|---|
| #000000 | rgb(0, 0, 0) | Black |
| #FFFFFF | rgb(255, 255, 255) | White |
| #FF0000 | rgb(255, 0, 0) | Red |
| #00FF00 | rgb(0, 255, 0) | Green |
| #2563EB | rgb(37, 99, 235) | Blue |
| #808080 | rgb(128, 128, 128) | Gray |
The same colour is shown three ways. RGB is what screens use directly. HSL (hue, saturation, lightness) is friendlier for tweaking — nudging the lightness gives you a tint or a shade without changing the hue. The five-swatch strip below the channels does exactly that: it blends your colour toward white on the left and toward black on the right, a quick way to build a palette around one base colour.
#2563EB) — the most common format in CSS and design tools;
compact and easy to copy and paste.rgb(37, 99, 235)) — handy when you need to read or adjust the
red, green and blue channels individually in code.rgba(37, 99, 235, 0.5) for 50% opacity over whatever sits behind it.hsl(221, 83%, 53%)) — the most intuitive when you want to shift
a colour's hue, saturation or lightness on its own, which is ideal for tints, shades and palettes.A six-digit hex code is three bytes written in base 16: the first two characters are red, the middle
two are green, and the last two are blue, each ranging from 00 (0) to FF (255). Hexadecimal counts
0–9 then A–F, so one hex digit covers sixteen values and a pair covers 256 — exactly the
range of a single colour channel. That neat fit is why colours are written in hex at all: two tidy
characters express a full 0–255 channel, and #FF0000 reads instantly as "all red, no
green, no blue."
Hex dominates web and app design — CSS, Figma, Sketch and Tailwind all accept it, and it is the format you will paste most often. RGB shows up wherever colour is manipulated in code: image editors, canvas and WebGL work, LED and hardware libraries, and anywhere you adjust one channel at a time. Because this tool shows hex, RGB, HSL and the individual R, G and B values at once, you can copy whichever format the tool in front of you expects without a second conversion step.
Hex codes come in three lengths. The 6-digit form (#2563EB) is the
standard — two characters each for red, green and blue. The 3-digit shorthand
(#25E) doubles each digit, so it can only express colours whose channel pairs repeat, which
is why not every colour has a short form. The 8-digit form adds two more characters for
alpha (transparency), so #2563EB80 is the same blue at about 50% opacity. This converter
accepts the 3- and 6-digit forms, with or without the leading #. Most modern browsers and design tools
understand all three lengths, so you can usually paste whichever one you have.
#2563EB is rgb(37, 99, 235) — red 37, green 99, blue 235. Each pair of hex digits is read as a value from 0 to 255.
Yes. A 3-digit code like #F0A is expanded by doubling each digit, so it becomes #FF00AA before conversion. The # is optional in either form.
The hex is first turned into RGB, then RGB is converted to hue, saturation and lightness. HSL describes the same colour in a way that is easier to adjust by eye.
It blends your colour toward white (lighter, on the left) and toward black (darker, on the right), giving a quick five-step palette built from a single base colour.
RGBA is RGB with a fourth value — alpha — that sets transparency from 0 (fully transparent) to 1 (fully opaque). Use RGBA when you want the background to show through a colour.
Convert it to HSL and change only the lightness value — raise it for a tint, lower it for a shade — while keeping the hue and saturation. The shades strip below the channels does this automatically.
People reach this tool searching for: