Color

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 #.

RGB
HSL
R
G
B

How to convert hex to RGB

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.

Common hex to RGB values

HexRGBName
#000000rgb(0, 0, 0)Black
#FFFFFFrgb(255, 255, 255)White
#FF0000rgb(255, 0, 0)Red
#00FF00rgb(0, 255, 0)Green
#2563EBrgb(37, 99, 235)Blue
#808080rgb(128, 128, 128)Gray

RGB, HSL and the shades strip

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.

Hex, RGB, RGBA and HSL — when to use each

Reading a hex code digit by digit

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."

Where you'll use hex and RGB

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.

3-digit, 6-digit and 8-digit hex

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.

Frequently asked questions

What is #2563EB in RGB?

#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.

Does the converter accept 3-digit hex codes?

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.

How is HSL calculated from a hex colour?

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.

What does the shades strip show?

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.

What is the difference between RGB and RGBA?

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.

How do I make a colour lighter or darker?

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.

Popular searches

People reach this tool searching for:

hex to rgb converterhex to rgbconvert hex to rgbhex to rgb colorhex code to rgbhex to rgba

Related tools