🎨 HEX to RGB Colour Converter
Converts colour codes between HEX (#FF5733) and RGB (255, 87, 51) in both directions, with a live swatch so you can see the colour as you type. Designers and developers use both formats in CSS, design tools and brand guides — this tool translates between them instantly, entirely in your browser.
How to use it
- Pick the direction: HEX to RGB, or RGB to HEX.
- Type the colour code — a HEX code like #FF5733, or RGB numbers like 255, 87, 51. You can also pick a colour with the colour picker.
- The converted colour appears instantly with a live preview swatch — copy either form straight into your CSS or design tool.
Example
Limitations
HEX codes must be 3 or 6 hexadecimal digits (0–9, A–F), with or without the # sign — #F53 is the short form of #FF5533. RGB values must be whole numbers from 0 to 255. Both formats describe the exact same colour, so converting never changes the colour itself — only how it is written. This tool converts the format; it does not suggest matching colours or check contrast.
Frequently asked questions
What is the difference between HEX and RGB?
They are two ways of writing the same colour. HEX writes it as six hexadecimal digits (#FF5733); RGB writes the red, green and blue amounts as three numbers from 0 to 255 (rgb(255, 87, 51)). CSS accepts both, so use whichever your team or design tool prefers.
Do I need the # sign?
No — #FF5733 and FF5733 both work, and the 3-digit short form works too: #F53 means the same as #FF5533.
Can I paste the result into my CSS?
Yes — the tool shows both the #RRGGBB form and the rgb(R, G, B) form, ready to paste into a stylesheet, a design tool or a website builder.