HEX to RGB Converter
Convert colours between HEX, RGB and HSL instantly: type a hex code, adjust the RGB sliders, or pick a colour, and see all three formats with a live preview swatch.
Runs in your browser — your code and data never leave this device
How do I convert HEX to RGB?
Type a HEX code: this free online hex to rgb converter shows the RGB and HSL values instantly, with a live preview of the colour. It works both ways — adjust the RGB numbers and the HEX code appears — and 3-digit hex works too, so #09F reads as #0099FF.
#2563EBrgb(37, 99, 235)hsl(221, 83%, 53%)Related tools
How to use the HEX to RGB Converter
- Type a hex code such as #2563EB or 09F into the HEX box, or click one of the preset colour chips.
- Adjust the red, green and blue numbers, or use the colour picker, to change the colour.
- Read the HEX, RGB and HSL values below the preview swatch, and copy whichever format you need.
- Paste the copied value straight into your CSS, design tool or document.
For the full picture — the manual formula, 3-digit hex, and where each colour format is used — read our guide: How to Convert HEX to RGB (Free Converter + Formula).
HEX, RGB and HSL: three names for one colour
A hex code is an RGB colour written in hexadecimal: two hex digits each for red, green and blue. The code #2563EB means red 37, green 99, blue 235 — the same colour as rgb(37, 99, 235). Hex is compact and copy-friendly, which is why stylesheets use it; RGB is easier to read at a glance, which is why design tools show it. Converting between them changes the notation, never the colour.
HSL describes the same colour differently: hue (the position on the colour wheel, 0 to 360 degrees), saturation (how vivid it is, 0 to 100 percent) and lightness (how bright, 0 to 100 percent). HSL is the friendliest format for adjusting a colour by hand: to make a lighter version of a blue, keep the hue and saturation and raise the lightness. This tool shows all three formats side by side, so you can work in whichever one suits the job.
Three-digit hex, and the hash
Hex codes come in two lengths. A six-digit code like #2563EB gives each channel two digits. A three-digit code like #09F is shorthand: each digit is doubled, so #09F means #0099FF. Only colours whose channel pairs repeat can be written short — #AABBCC becomes #ABC, but #2563EB has no short form. This tool accepts both lengths, with or without the leading hash.
The hash itself is only a marker that says what follows is a hex colour; it is not part of the value. That is why the RGB fields in this tool never show it, and why pasting a code without the hash works exactly the same as pasting one with it.
Picking colours that work together
HSL makes colour schemes easy. Colours with the same hue and saturation but different lightness form a natural scale, from a dark shade for text to a pale tint for backgrounds. Colours opposite each other on the wheel — hues 180 degrees apart — contrast strongly and suit accents and calls to action. This converter is the starting point: convert a brand colour, note its HSL values, then vary the lightness to build the scale.
One practical check matters more than any scheme: contrast. Text needs enough contrast against its background to be readable, and the standard to aim for is a ratio of at least 4.5 to 1 for body text. If a colour pair looks washed out in the preview swatch, it will look worse on a real screen in bright light.
One more habit is worth building: save the colours you use. A brand palette of three to five colours, each recorded in HEX for code and HSL for adjustments, keeps a site consistent without anyone having to remember a code. When a new shade is needed, start from an existing palette colour and change only the lightness: the result will belong to the same family, and the site will look designed rather than assembled from whatever looked good at the time.
RGB to hex converter free: both directions, one page
An rgb to hex converter free is the same page run backwards: type or adjust the three RGB numbers — red, green and blue, each from 0 to 255 — and the HEX code appears alongside the HSL values. Each number becomes one pair of hex digits, so rgb(255, 87, 51) is #FF5733, and the live preview shows the colour as you change it.
Convert 3 digit hex to rgb without expanding it first: #09F is read as #0099FF automatically, each digit doubled, which is the shorthand every stylesheet accepts. A hex to hsl converter online free is included too — the HSL values appear with the RGB ones, so lightening or darkening the colour is one number away. Preset colour chips and a colour picker make starting from a colour, rather than a code, just as quick.
Frequently asked questions
What is the difference between HEX and RGB?
None in meaning: HEX is RGB written in hexadecimal. The code #FF0000 and the value rgb(255, 0, 0) describe exactly the same red.
What does 3-digit hex mean?
Each digit is doubled: #abc is #aabbcc. Only colours whose channel pairs repeat can be written in the short form.
How do I get HSL from HEX?
Convert HEX to RGB first, then apply the standard formula for hue, saturation and lightness. This tool does both steps for you and shows the result instantly.
Why do colours look different on other screens?
Screens vary in calibration, brightness and colour space, so the same values render slightly differently. The numbers are exact; the display is approximate.
Is my data uploaded anywhere?
No. This tool runs entirely in your browser using JavaScript. Nothing you type is uploaded, stored or sent anywhere.
How do hex codes and RGB values relate?
They are two ways of writing the same colour: HEX writes the red, green and blue values as six hexadecimal digits, like #FF5733, while RGB writes the same three values as decimal numbers, like rgb(255, 87, 51). The colour is identical — only the notation differs.
Can I convert RGB back to HEX?
Yes — adjust the three RGB numbers and the HEX code appears at once. Each number, from 0 to 255, becomes one pair of hex digits, so the conversion works in both directions.
Does it support 3-digit hex codes?
Yes — #09F is read as #0099FF automatically, with each digit doubled. That is the standard shorthand, and it works the same way in stylesheets.