RGB to HEXA
Convert your RGB color format to HEXA format.
About this tool
Type or paste an RGB color, or choose one with the picker, and the converter shows it as HEXA as you type, with a preview and every other format underneath, each with its own copy button. It reads colors written in any of the formats, and color names like “tomato”, too.
How to convert RGB to HEXA
RGB already gives the red, green and blue channels, from 0 to 255. To write a HEXA code, turn each channel into two base-16 digits, then add alpha × 255 the same way: 168, 208 and 141 are a8, d0 and 8d, and 0.8 × 255 = 204 is cc, which makes #a8d08dcc.
An RGB color is always solid, so its alpha comes out as ff.
RGB to HEXA examples
| Color | RGB | HEXA |
|---|---|---|
| Sage green | rgb(168, 208, 141) |
#a8d08dff |
| Red | rgb(255, 0, 0) |
#ff0000ff |
| Tomato | rgb(255, 99, 71) |
#ff6347ff |
| Gold | rgb(255, 215, 0) |
#ffd700ff |
| Dodger blue | rgb(30, 144, 255) |
#1e90ffff |
| Indigo | rgb(75, 0, 130) |
#4b0082ff |
| Black | rgb(0, 0, 0) |
#000000ff |
| White | rgb(255, 255, 255) |
#ffffffff |
What is RGB?
RGB writes a color as its red, green and blue channels, each from 0 to 255, the way screens make color by mixing light. rgb(0, 0, 0) is black and rgb(255, 255, 255) is white.
What is HEXA?
HEXA adds a fourth pair of digits to a HEX code for alpha, the opacity: ff is solid, 80 about half see-through and 00 invisible. All current browsers accept eight-digit codes in CSS.