HEX to RGB Converter
Paste a HEX color and read its rgb() string the moment you type. The converter accepts full six-digit codes, three-digit shorthand, and values with or without the leading # sign, then shows the same color as HEX, RGB and HSL side by side. Everything is computed in your browser, so the colors you test stay on your machine.
How to convert HEX to RGB
- Type or paste your HEX color into the input, for example #ff0000 or ff0000.
- Or click the color swatch on the left to pick a shade visually.
- Watch the swatch preview and the rgb() value update live as you edit.
- Compare the HEX, RGB and HSL cards below to see all three formats at once.
- Press Copy next to the RGB output and paste it into your CSS or design tool.
Examples
Pure red
#ff0000
rgb(255, 0, 0)
Tailwind blue-500
#3b82f6
rgb(59, 130, 246)
Green shorthand expands to six digits
#0f0
rgb(0, 255, 0)
Frequently asked questions
What is a HEX color code?
A HEX code is a six-digit hexadecimal number like #3b82f6. The three pairs encode red, green and blue, each running from 00 to ff, which is 0 to 255 in decimal.
What is an RGB color?
RGB describes a color by its red, green and blue channels, each from 0 to 255. In CSS it is written as rgb(59, 130, 246), and browsers mix those three channels to produce the final shade.
Does it support 3-digit shorthand like #f00?
Yes. Shorthand HEX is expanded by doubling each digit, so #f00 becomes #ff0000 and converts to rgb(255, 0, 0). The digit 0f0 becomes 00ff00, giving rgb(0, 255, 0).
Do I need to type the # sign?
No. The parser strips a leading # if present, so ff0000 and #ff0000 give the same result. This makes it easy to paste raw values copied from spreadsheets or config files.
What happens if I enter an invalid code?
If the value is not three or six valid hex digits, the tool shows an Invalid HEX color message instead of a result. Fix the length or remove any stray characters and it will update again.
Where do I use the RGB value?
Mostly in CSS, where rgb() is a standard color format, and in design tools like Figma or Sketch that accept red, green and blue channel values directly.
What about alpha or transparency?
This tool converts opaque colors only. For transparency, add an alpha channel yourself using rgba(), for example rgba(255, 0, 0, 0.5), where the last value is the opacity from 0 to 1.
Can I see the HSL value too?
Yes. Below the main result the tool shows a small grid with the HEX, RGB and HSL forms of the current color, so you can grab whichever notation your project needs.
Is my color data uploaded anywhere?
No. The conversion runs entirely in your browser using a small pure function, so the colors you enter never leave your device or reach a server.
Learn more
- HEX and RGB color notation explained
How hexadecimal color codes map to red, green and blue channels, why shorthand works, and when to reach for RGB over HEX in CSS.
Related tools
RGB to HEX
Convert RGB to HEX online. Paste rgb(255, 0, 0) or 255,0,0 and get the matching hex color code instantly. Runs in your browser.
HEX to HSL
Convert a HEX color to HSL online. Paste a hex code like #3b82f6 and get the hue, saturation and lightness instantly. Runs in your browser.
Air Fryer Converter
Convert any conventional oven recipe to air fryer settings. Lower the temperature by 25 F and cut the cook time by about 20 percent automatically.
Baker's Percentage Calculator
Turn a bread formula into grams with baker's percentages. Flour is 100 percent, enter water, salt and yeast percents to get weights and hydration.
Baking Pan Converter
Swap one baking pan for another and scale the batter to fit. Compares pan areas for round, square and rectangular pans and gives a batter scale factor.
Binary to Decimal
Convert binary to decimal online. Paste any binary number, with or without spaces, and get the exact base-10 value instantly. Runs in your browser.