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.

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.

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