Hex to RGB Converter
Convert a hex colour code to RGB, RGBA and HSL — or type RGB values to get the hex back. Short 3-digit hex and 8-digit hex with an alpha channel are both supported, with a live preview of the colour.
Preview — shown over the page background, so lower opacity lets it show through.
How to use this
Type a hex code — with or without the # — pick a colour from the swatch, or type the red, green and blue values directly. Every format updates at once; click Copy next to the one you need. The opacity slider adds an alpha channel, which is how colours are made semi-transparent in CSS.
Hex, RGB and HSL in plain words
A hex code is just RGB written in base 16: #2563EB means red 25, green 63, blue EB — 37, 99 and 235 in ordinary numbers. The short 3-digit form doubles each digit, so #F00 is #FF0000, pure red. An 8-digit code adds two more digits for opacity: #FF000080 is red at about 50% opacity. HSL describes the same colour the way people think about it — hue (the colour itself, as an angle), saturation (how vivid) and lightness (how bright) — which is why designers often prefer it for building colour schemes.
Frequently asked questions
How do I convert a hex colour to RGB?
Type the hex code into the box (with or without the #) and the RGB, RGBA and HSL values appear instantly. Click Copy next to the format you need.
Can I convert RGB back to hex?
Yes. Type the red, green and blue values into the RGB boxes — or pick a colour from the swatch — and the hex code updates at the same time.
What is 8-digit hex?
An 8-digit hex code adds two digits for opacity (the alpha channel) to a normal 6-digit code: #FF000080 is red at about 50% opacity. This converter reads and produces them; use the opacity slider to set the alpha.
What does #F00 mean?
Short 3-digit hex doubles each digit, so #F00 is #FF0000 — pure red. Every 3-digit code works this way.
What is the difference between RGB and HSL?
RGB mixes red, green and blue light. HSL describes a colour as hue (which colour), saturation (how vivid) and lightness (how bright) — often easier for building colour schemes. Both describe the same colours.