RGB to HEX Converter

Enter an RGB value like rgb(255, 99, 71) — or just “255 99 71” — to get its hex code.

Runs in your browser — nothing is uploaded

Shades & tints

Color values

Aa
HEX—
RGB—
HSL—
HSV—
CMYK—

How RGB to HEX works

Each RGB channel (0–255) becomes a two-digit hexadecimal number (00–FF). Values below 16 get a leading zero.

rgb(R, G, B) → #RRGGBB

Example: rgb(0, 128, 128) → 00, 80, 80 → #008080

Common colors

ColorHEXRGB
White#FFFFFFrgb(255, 255, 255)
Black#000000rgb(0, 0, 0)
Red#FF0000rgb(255, 0, 0)
Green#008000rgb(0, 128, 0)
Blue#0000FFrgb(0, 0, 255)
Yellow#FFFF00rgb(255, 255, 0)
Orange#FFA500rgb(255, 165, 0)
Purple#800080rgb(128, 0, 128)
Gray#808080rgb(128, 128, 128)
Navy#000080rgb(0, 0, 128)
Teal#008080rgb(0, 128, 128)
Pink#FFC0CBrgb(255, 192, 203)

How to use RGB to HEX

  1. Click the swatch to pick a color, or type/paste a color code.
  2. Copy the format you need — HEX for CSS, RGB for design tools, CMYK for print.
  3. Click a shade or tint to explore nearby colors.

Questions

How do I convert RGB to HEX?

Convert each of the three values (0–255) to a two-digit hexadecimal number and join them: rgb(15, 118, 110) → 0F, 76, 6E → #0F766E.

Can I enter RGB without “rgb()”?

Yes. “15, 118, 110” and “15 118 110” both work.