HEX ↔ RGB Converter
HEX ↔ RGB Converter converts a HEX color code to RGB values and back instantly, with a live color-picker preview and ready-to-paste CSS/Tailwind snippets. Everything runs in your browser, no color ever leaves your device.
How it works
- 1Type a HEX code (#RRGGBB or the short #RGB form) or RGB values (0-255) into the input.
- 2The color appears instantly in the preview and in the opposite format; you can also pick it directly with the color picker.
- 3A 3-digit short HEX (#f0a) is automatically expanded to its 6-digit form (#ff00aa).
- 4Copy the ready-made CSS `color: #rrggbb` or `rgb()` function snippet.
Frequently asked questions
What's the difference between HEX and RGB?−+
Both describe the same color differently: HEX packs the red/green/blue channels into a two-digit hexadecimal number each (#ff0000); RGB writes the same three channels as decimal numbers separately (255, 0, 0).
How does the 3-digit short HEX work?−+
A short form like #f0a expands by repeating each digit: f→ff, 0→00, a→aa, so it equals #ff00aa. It only works when both digits of each channel match.
Can it convert the alpha (transparency) channel too?−+
Yes, if you enter an 8-digit HEX (#rrggbbaa) or rgba(), the alpha value is preserved when converting to the other format.
Are the colors I enter stored anywhere?−+
No, the conversion runs entirely in your browser with JavaScript, nothing is sent to a server.
Embed on your site
<iframe src="https://toolsqube.com/en/color/hex-rgb-converter/embed" width="480" height="360" style="border:0;border-radius:14px" title="HEX ↔ RGB Converter · ToolsQube" loading="lazy"> </iframe>
Want to go deeper on this topic: Color and Design Guide →