Color HEX / RGB Converter
Convert any colour between HEX, RGB and HSL with a live preview — type a code, drag the picker or set the channels and copy the result.
HEX, RGB and HSL — the same colour, three notations
Screens build every colour from three channels of light: red, green and blue. The three colour formats you meet on the web are just different ways of writing those same three numbers. RGB lists each channel from 0 to 255, so rgb(37, 99, 235). HEX packs the same values into a six-digit hexadecimal string, #2563EB, which is what most CSS and design tools use. HSL rewrites the colour as hue, saturation and lightness, which is friendlier when you want to nudge a shade lighter or more vivid.
This converter keeps all three in sync. Type a HEX code, drag the picker or set the R/G/B numbers and the other formats update instantly. It also accepts three-digit shorthand like #0AF and expands it for you.
Quick conversion reference
| Colour | HEX | RGB |
|---|---|---|
| Black | #000000 | rgb(0, 0, 0) |
| White | #FFFFFF | rgb(255, 255, 255) |
| Pure red | #FF0000 | rgb(255, 0, 0) |
| Pure green | #00FF00 | rgb(0, 255, 0) |
| Pure blue | #0000FF | rgb(0, 0, 255) |
How HEX maps to RGB. Each pair of hex digits is one channel in base 16. In #2563EB, 25 is 37 (red), 63 is 99 (green) and EB is 235 (blue). That is exactly how the converter turns one into the other.
Frequently asked questions
How do I convert a HEX code to RGB?
Split the six-digit HEX into three pairs and read each as a base-16 number. For #2563EB that is 25→37, 63→99 and EB→235, giving rgb(37, 99, 235). Paste the HEX into the tool above and the RGB values appear automatically.
What is the difference between RGB and HSL?
RGB describes a colour by how much red, green and blue light it mixes. HSL describes the same colour by its hue (position on the colour wheel), saturation (how vivid) and lightness. HSL is handy when you want a lighter or more muted version of a colour without guessing new RGB numbers.
What does a 3-digit HEX colour like #0AF mean?
It is shorthand. Each digit is doubled, so #0AF expands to #00AAFF. The tool accepts both the short and full forms and converts them the same way.
Are HEX and RGB colours exactly equal?
Yes. Standard 6-digit HEX and 8-bit RGB describe the identical set of colours — they are two notations for the same three 0–255 channel values, so converting between them is lossless.
Does this colour converter send my colours anywhere?
No. All the conversion happens in your browser with JavaScript. Nothing you type or pick is uploaded, which makes it safe to use for private brand or design work.
This tool runs entirely in your browser — nothing you type is sent to our servers. Tudug is reader-supported and may earn from ads.