Hex to RGB Converter - Convert Hex Code to RGB Values

Ottimizzazione del motore di ricerca
  1. Home
  2. Developer Tools
  3. Hex to RGB Converter
Share: Report

Hex to RGB Converter

100% free · Runs 100% in your browser · Hex to RGB with live colour preview · No signup needed

Expanded hex code#FF5733
RGB values255, 87, 51
3-digit shorthand expands by doubling each digit: #F53 becomes #FF5533. The expanded code shown above is the one actually converted.

Type a hex code with or without the # — 6 digits (FF5733) or 3-digit shorthand (F53). Each hex pair is one colour channel from 0 to 255.

Try an example: #1E90FF → 30, 144, 255 (Dodger Blue)

Popular colours

ColourHexRGB
Black#0000000, 0, 0
White#FFFFFF255, 255, 255
Red#FF0000255, 0, 0
Lime#00FF000, 255, 0
Blue#0000FF0, 0, 255
Burnt orange#FF5733255, 87, 51
Dodger Blue#1E90FF30, 144, 255

Di Hex to RGB Converter

Every colour you see on a screen is built from three numbers: red, green, and blue. Web designers usually write those numbers as a hex code, a short string of six characters after a hash sign, such as #FF5733. The free Hex to RGB Converter translates that code into the three separate RGB values a designer, developer, or colour picker needs, so you can use the same colour in CSS, in a design tool, or in code that expects numbers instead of a hex string. It runs entirely in your browser, needs no sign-up, and gives you the answer the moment you type.

Hex codes are everywhere in web design. A brand guideline might say the primary colour is #1E90FF, a CSS file might set a background to #FFFFFF, and a design mockup might label a button #000000. When you need that colour in a different format, for example to set an opacity with rgba, to match a colour in an image editor, or to feed a script that takes separate red, green, and blue values, you need the conversion. Doing it by hand is slow and error-prone, because each pair of hex digits has to be turned into a decimal number. This converter does the whole job instantly and shows a preview swatch so you can see the colour as well as read its numbers.

How a hex code becomes RGB

A hex code is simply three pairs of hexadecimal digits. Hexadecimal is a base-16 number system, which uses the digits 0 to 9 and the letters A to F, where A stands for 10, B for 11, C for 12, D for 13, E for 14, and F for 15. The first pair sets the red channel, the second pair sets the green channel, and the third pair sets the blue channel. Each pair can represent any value from 0 to 255, so a hex code can describe more than 16 million different colours. The hash sign at the front is only a marker that says this is a hex colour; it is not part of the number itself, which is why this tool accepts your code with or without it.

Hex codeRedGreenBlueCSS value
#FF57332558751rgb(255, 87, 51)
#1E90FF30144255rgb(30, 144, 255)
#000000000rgb(0, 0, 0)
#FFFFFF255255255rgb(255, 255, 255)
#00FF0002550rgb(0, 255, 0)
#FFD7002552150rgb(255, 215, 0)

The table shows the pattern clearly. In #FF5733, the first pair FF is the largest two-digit hex value, so red is at its maximum of 255, while the middle pair 57 converts to 87 and the last pair 33 converts to 51. In #1E90FF, the red pair 1E is small at 30, green 90 is 144, and blue FF is at the full 255, which is why the colour is a strong dodger blue. Black is #000000 because every channel is zero, so no light is shown at all, and white is #FFFFFF because every channel is at its maximum, so the full mix of red, green, and blue light reaches your eye.

Worked example: #FF5733 and #1E90FF

Here are the worked checks the converter is built around. Take #FF5733 and split it into its three pairs: FF, 57, and 33. FF in hexadecimal equals 15 times 16 plus 15, which is 255. The pair 57 equals 5 times 16 plus 7, which is 87. The pair 33 equals 3 times 16 plus 3, which is 51. So #FF5733 becomes red 255, green 87, blue 51, written in CSS as rgb(255, 87, 51). Take #1E90FF and do the same: 1E equals 1 times 16 plus 14, which is 30; 90 equals 9 times 16 plus 0, which is 144; FF equals 255. So #1E90FF becomes rgb(30, 144, 255). Enter either code in the tool and you will see exactly these numbers, with the colour shown in the preview swatch beside them.

The two edge cases are worth knowing. #000000 converts to red 0, green 0, blue 0, the complete absence of light, which is black on every screen. #FFFFFF converts to red 255, green 255, blue 255, the full mix of all three channels, which is white. Every other colour sits between those two extremes. A pure red is #FF0000, which is rgb(255, 0, 0). A pure green is #00FF00, which is rgb(0, 255, 0). A pure blue is #0000FF, which is rgb(0, 0, 255). Mixing the channels in different amounts creates every shade you see online, from soft pastels with high values in all three channels to deep, dark tones with low values.

How to use this converter

  • Type or paste your hex code into the input box, with or without the leading hash sign.
  • If your code uses the 3-digit shorthand, such as #F53, the tool expands it to #FF5533 before converting.
  • Read the red, green, and blue values shown, each on a scale from 0 to 255.
  • Check the colour preview swatch to confirm the result matches the colour you expected.
  • Copy the RGB values or the ready-made CSS value, such as rgb(255, 87, 51), with one click.
  • Try another code straight away; the tool updates instantly with every keystroke.

Once you have the RGB values, you may want to go further. The RGB to CMYK Converter turns the same colour into the four CMYK values used for print, so a screen colour can be matched on paper. The Image Colour Picker finds the hex code of any colour in a photo or screenshot, which you can then paste straight into this converter. And the CSS Gradient Generator builds smooth colour blends from two or more hex codes, with the CSS ready to copy.

The 3-digit shorthand, explained honestly

The gotcha with hex codes is the 3-digit shorthand, and this tool states it plainly. A code such as #F53 is a short way of writing #FF5533, not a different colour. Each single digit is doubled: F becomes FF, 5 becomes 55, and 3 becomes 33. The tool expands the shorthand first and shows you the expanded six-digit code it actually converted, so there is no mystery about which colour you got. #F53 expands to #FF5533, which converts to rgb(255, 85, 51). The shorthand exists because it saves typing, and browsers accept both forms, but a six-digit code is clearer when you share a colour with someone else, because nobody has to remember the doubling rule.

Colour work often leads to building something, whether that is a portfolio, a design blog, or a small business site where your brand colours need to shine. FistHost shared hosting starts at just $0.99/month, with a free domain included with the annual plan, so you can launch your site at FistHost and put your chosen colours to work on pages you own.

Tips for working with hex and RGB

A few habits make colour work easier. Keep a short list of your brand colours in both hex and RGB, so you never have to convert the same code twice. When a colour looks wrong on screen, check the channel values first: a green that is too strong usually means the middle pair is higher than you intended. Remember that RGB values are only for screens; for print, convert to CMYK, because the same numbers will look different on paper. When you need a lighter or darker version of a colour, raise or lower all three channels together to keep the hue the same, and change one channel more than the others when you want to shift the hue. Finally, test your colours on a real phone as well as a desktop screen, because screens vary and a colour that looks perfect on one display can look slightly different on another.

Frequently asked questions

What is the difference between hex and RGB? They describe the same colour in two notations. A hex code writes the three channels as six hexadecimal digits, while RGB writes them as three decimal numbers from 0 to 255. Both are used in CSS, and this tool converts between them instantly.

Whether you are matching a brand colour, setting a background in CSS, or checking the exact values behind a design mockup, this converter gives you the numbers in seconds, with a preview you can trust. Enter your hex code, copy the RGB values, and use them wherever your project needs them. And if your colour work is heading toward a website of your own, FistHost shared hosting starts at just $0.99/month with a free domain included with the annual plan, so you can start building today at FistHost and show your colours to the world.

User Reviews

No reviews yet. Be the first to review this tool!

Write a Review

★★★★★

Captcha

Reviews are protected by captcha and moderated before they appear.


FistHost

Hosting That Grows With You

Start at $0.99/mo and scale
when you are ready

Start Growing
FistHost Blazing-Fast Web Hosting Plans from $0.99/mo · Free domain included Get Hosting