HEX to RGB Converter
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free HEX to RGB converter. Paste a HEX, RGB or HSL color to get all three formats, with transparency, ready to copy into CSS or design tools.
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the HEX to RGB converter
Type or paste a colour in any common format, or pick one with the colour picker. The HEX to RGB converter recognises:
- HEX:
#FF6347,FF6347, short#F63, and with transparency#FF634780or#F638. - RGB:
rgb(255, 99, 71),rgba(255, 99, 71, 0.5), the modern space-separated formrgb(255 99 71 / 50%), and plain numbers255, 99, 71. - HSL:
hsl(9, 100%, 64%),hsla(9, 100%, 64%, 0.5)and the space-separated form.
It shows the colour as a swatch and gives you every format, each with its own Copy button: HEX, HEX with alpha (when the colour is transparent), RGB or RGBA, HSL or HSLA, and the three red, green and blue numbers on their own. The picker and the text box stay in step, so picking a colour fills in the code and typing a code updates the picker. Nothing leaves your browser.
HEX, RGB and HSL explained
All three describe the same colours on screens. They're just different ways of writing them.
RGB
Screens make colours by mixing red, green and blue light. RGB gives the amount of each, from 0 to 255:
rgb(255, 0, 0)is pure red,rgb(0, 0, 0)is black (no light),rgb(255, 255, 255)is white (all three at full strength),rgb(255, 99, 71)is tomato: lots of red, some green and a little blue.
HEX
A HEX code is the same three numbers written in hexadecimal (base 16), two characters each: #RRGGBB. Hexadecimal uses the digits 0–9 and the letters A–F, so each pair runs from 00 (0) to FF (255).
To convert HEX to RGB by hand, take each pair and convert it from base 16:
FF= 15 × 16 + 15 = 25563= 6 × 16 + 3 = 9947= 4 × 16 + 7 = 71
So #FF6347 is rgb(255, 99, 71). The HEX to RGB converter does this instantly, and in reverse.
Short HEX codes double each character: #F63 means #FF6633, which is rgb(255, 102, 51). Only colours whose pairs are both the same digit can be written this way.
HEX with alpha adds a fourth pair for opacity: #FF634780 is tomato at 50% opacity, because 80 in hexadecimal is 128, and 128 ÷ 255 is about 0.5.
HSL
HSL describes colour the way people think about it:
- Hue: the position on the colour wheel, in degrees (0 is red, 120 green, 240 blue).
- Saturation: how vivid the colour is, from 0% (grey) to 100% (full colour).
- Lightness: from 0% (black) through 50% (the pure colour) to 100% (white).
Tomato is hsl(9, 100%, 64%): a red slightly towards orange, fully saturated, a little lighter than the pure colour. HSL makes it easy to create related colours: keep the hue and change the lightness for a darker or lighter shade, or lower the saturation for a muted version.
The converter rounds HSL to whole numbers, which is how it's usually written. Because of that rounding, converting HSL back to HEX can occasionally land one step away from the original (for example, 63.9% lightness becomes 64%). If you need an exact match, keep the HEX code as your reference.
Which format should you use?
- HEX is the most common in web design, brand guidelines and design tools like Figma and Canva. It's compact and easy to copy.
- RGB and RGBA are useful in CSS when you need transparency, and in code that handles colour channels separately.
- HSL is the easiest to adjust by hand, and great for building a palette of shades from one brand colour.
In CSS, all three work everywhere, so choose whichever your team finds easiest to read. Many design systems store colours as HEX and use HSL to generate lighter and darker variants.
What about CMYK and Pantone?
Screens use RGB light; printers use CMYK ink (cyan, magenta, yellow and black), and brands often specify Pantone spot colours for print. Converting between them isn't a simple formula: the result depends on the printer, the paper and the colour profile, and many bright screen colours can't be printed exactly. That's why this HEX to RGB converter doesn't give CMYK values. For print, ask your printer or designer for the CMYK or Pantone equivalents of your brand colours, and record them in your brand guidelines alongside the HEX codes.
Building a brand colour palette
A simple, consistent palette makes everything you publish look like it belongs together. A common structure:
- One or two brand colours for logos, buttons and highlights.
- A dark text colour, often a near-black like
#1A1A1A, softer than pure black. - One or two neutral greys for borders, backgrounds and secondary text.
- Status colours for success, warning and error messages, if your site needs them.
Record each colour in HEX, RGB and HSL so designers, developers and anyone making social graphics can use the format their tool expects. Then check which combinations are readable: the color contrast checker tests any text and background pair against WCAG accessibility levels. Bright brand colours often need a darker shade for text.
Where you'll need colour codes
- Website and email design: CSS, website builders and email templates.
- Social media graphics: Canva, Adobe Express and other design tools accept HEX codes.
- Email signatures: the email signature generator takes an accent colour.
- QR codes: the QR code generator can use your brand colour, as long as it's dark enough to scan.
- Presentations and documents: PowerPoint, Keynote, Google Slides and Word all accept RGB or HEX in their custom colour settings.
Colour codes in CSS
All the formats from the HEX to RGB converter can be pasted straight into CSS:
.button { background: #FF6347; }
.button:hover { background: rgb(231 35 0); }
.overlay { background: rgba(255, 99, 71, 0.5); }
.tag { background: hsl(9 100% 94%); color: hsl(9 100% 30%); }
A few tips:
- Use CSS custom properties (variables) for your brand colours, such as
--brand: #FF6347;, so you change a colour in one place. - Modern CSS accepts the space-separated forms (
rgb(255 99 71 / 50%)); the comma forms work everywhere too. The converter reads both. - HEX codes are case-insensitive:
#ff6347and#FF6347are the same colour. - Named colours such as
tomatoalso exist in CSS, but there are only about 150 of them; codes give you all 16.7 million colours.
Picking a colour from an image or screen
To find the code of a colour you can see:
- On a website: open your browser's developer tools, inspect the element, and look for its
colororbackground-colorvalue. - In an image: open it in a design tool and use the eyedropper; most show the HEX code.
- Anywhere on screen: Windows PowerToys includes a colour picker (Win + Shift + C), and macOS has the Digital Color Meter app.
Paste the result into the HEX to RGB converter to get every format.
A worked example
A bakery's designer sends the brand colour as #FF6347. The owner needs it for three things: the website (where the developer prefers RGB), a social media template in Canva (HEX) and a semi-transparent overlay on photos.
Pasting #FF6347 into the HEX to RGB converter gives rgb(255, 99, 71) and hsl(9, 100%, 64%). Typing rgba(255, 99, 71, 0.5) gives the overlay colour in every format, including the 8-digit HEX #FF634780. The owner checks the colour in the color contrast checker, sees it's too light for small text on white, and adds a darker shade for links to the brand guidelines.
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.
Frequently asked questions
How do I convert HEX to RGB?
Paste the HEX code into the HEX to RGB converter. By hand, convert each pair of characters from base 16: FF is 255, 63 is 99, 47 is 71, so #FF6347 is rgb(255, 99, 71).
Can it convert RGB to HEX?
Yes. Enter an RGB colour such as rgb(255, 99, 71) or just 255, 99, 71, and the HEX code appears with the other formats.
What is an 8-digit HEX code?
A HEX colour with a fourth pair for transparency. #FF634780 is #FF6347 at about 50% opacity.
Does it convert to CMYK?
No. CMYK depends on the printer and colour profile, so there's no single correct conversion. Ask your printer for CMYK or Pantone values.
Why might HSL round-trips differ slightly?
HSL is rounded to whole numbers, so converting it back to HEX can be one step off. Keep the HEX code as your exact reference.
Is the HEX to RGB converter free?
Yes. It's free with no sign-up, and it runs entirely in your browser.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.