RGB to HEX converter
Turn RGB values into a hex color code.
Runs in your browser. Nothing you type is sent anywhere.
- Paste rgb() or rgba()
- 8-digit hex with alpha
- Updates as you type
How to convert RGB to HEX
- Paste an rgb() or rgba() value, or type each channel.
- Set alpha below 1 to get an 8-digit hex code as well.
- Copy the hex code.
RGB to hex examples
| RGB | Hex | Note |
|---|---|---|
| rgb(255, 136, 0) | #FF8800 | Standard conversion |
| rgb(0, 0, 0) | #000000 | Black |
| rgba(255, 136, 0, 0.5) | #FF880080 | Alpha adds 2 digits |
| 255, 136, 0 | #FF8800 | Plain numbers work too |
How alpha becomes hex digits
Multiply alpha by 255, round to the nearest whole number, then write it as two hex digits at the end of the code.
| Alpha | Hex suffix |
|---|---|
| 1 (solid) | none needed |
| 0.75 | BF |
| 0.5 | 80 |
| 0.25 | 40 |
| 0 (invisible) | 00 |
Where 8-digit hex works
- CSS accepts #RRGGBBAA in every current browser: Chrome, Firefox, Safari and Edge.
- SVG fill and stroke attributes accept 8-digit hex in modern browsers too.
- Some older image editors and design tools only read 6-digit hex and drop or reject the alpha pair, so keep a solid 6-digit copy for those cases.
RGB to HEX FAQ
How do I convert RGB to HEX by hand?
Write each channel as a two-digit base 16 number and join them. rgb(255, 136, 0) becomes FF, 88 and 00, so #FF8800.
How is opacity written in hex?
Multiply the alpha by 255, round it and write it as two hex digits at the end. An alpha of 0.5 becomes 80, so rgba(255, 136, 0, 0.5) is #FF880080.
Which formats can I paste?
rgb(255, 136, 0), rgba(255, 136, 0, 0.5), the newer rgb(255 136 0 / 50%) and plain numbers like 255, 136, 0. A hex code works too.
Is #ff8800 different from #FF8800?
No, case does not matter in hex colors. Tick Uppercase if your style guide prefers capitals.
Can I type a color name like orange instead of numbers?
No. This converter reads numeric rgb(), rgba() and hex values only, since matching CSS's 148 named colors would need its own lookup table.
Why did my hex code change slightly after I typed a percentage?
Percentage channels like rgb(94% 53% 0%) get converted to the nearest of 256 steps per channel, so rounding can shift the result by 1 in some channels.
Does the alpha channel round the same way in every browser?
Yes. The math here, multiply by 255 then round to a whole number, is standard and gives the same 2 hex digits regardless of browser, since this page does the conversion itself instead of relying on a browser API that might differ.
Can I convert a color with a percentage-based alpha, like 50%?
Yes. rgba(255, 136, 0, 50%) and the newer rgb(255 136 0 / 50%) both work, alongside the older 0 to 1 decimal syntax for alpha.