HEX to RGB Converter
This hex to rgb converter turns any hex colour code into its red, green and blue values, and it also works in reverse. Designers, developers and students use it to match colours between code and design tools. Type a hex code like #FF5733, or switch to the RGB to HEX tab and type the three numbers instead.
How the conversion works
A hex colour is three pairs of hexadecimal digits. Each pair stands for one colour channel: red, green and blue. The tool follows these steps:
- It reads the six hex digits, ignoring an optional leading #.
- It converts each pair from base 16 to an ordinary number from 0 to 255.
- It shows the three numbers as the RGB value, with a colour swatch.
- In reverse, it converts each RGB number back to two hex digits and joins them.
Worked example
Convert #FF5733 to RGB:
- Split into pairs: FF, 57, 33.
- FF in hex = 15 × 16 + 15 = 255. 57 in hex = 5 × 16 + 7 = 87. 33 in hex = 3 × 16 + 3 = 51.
- Result: RGB 255, 87, 51.
- Reverse check: 255 = FF, 87 = 57, 51 = 33, so RGB 255, 87, 51 gives #FF5733.
How to use
- Pick the direction: HEX to RGB, or RGB to HEX.
- Type your hex code (with or without #) or your three RGB numbers from 0 to 255.
- Press Convert and read the result with the colour swatch.
Limits
This tool converts colours only. It does not pick colours for you, check contrast ratios, or convert to other colour models like HSL or CMYK. It accepts 6-digit hex codes (3-digit shorthand is expanded automatically) and whole RGB numbers from 0 to 255.
Frequently asked questions
Do I need the # sign in the hex code?
No. You can type FF5733 or #FF5733. Both give the same result.
What does RGB 255, 87, 51 mean?
It means full red (255), a medium amount of green (87), and a small amount of blue (51). Together they make the warm orange-red of #FF5733.
Why does my hex code show an error?
The code must have six valid hex digits: the numbers 0 to 9 and the letters A to F. Codes like #GGGGGG use letters outside A to F, so the tool asks for a valid code.
Can I use this hex to rgb converter for CSS colours?
Yes. The RGB numbers work directly in CSS as rgb(255, 87, 51), and the hex code works as #FF5733.
Related tools
Browse all CalcNova converters
Base-N Converter — converts numbers between binary, decimal, octal and hexadecimal.
