Convert RGB to HEX

Paste a RGB color to get its HEX value — and every other format — with a live swatch. All in your browser.

RGB to HEX, explained

RGB describes a color by its red, green and blue channels, each from 0 to 255 — the form canvas drawing and image code expect.

A HEX code writes the red, green and blue channels as a six-digit hexadecimal number prefixed with #, the format most design tools and stylesheets use.

Worked example

rgb(245, 158, 11) converts to #f59e0b. The converter above is pre-filled with this color — edit it or pick your own to see the result update live.

RGB to HEX reference table

ColorRGBHEX
Amber rgb(245, 158, 11) #f59e0b
Navy rgb(10, 24, 40) #0a1828
Red rgb(220, 38, 38) #dc2626
Green rgb(22, 163, 74) #16a34a
Sky rgb(14, 165, 233) #0ea5e9

Common uses

RGB values from a colour picker or screenshot tool often need to become the compact HEX codes used throughout stylesheets and design files.

Related conversions

Need another format? The full color converter reads HEX, RGB, HSL, OKLCH and CSS named colors and shows them all at once.

Frequently asked questions

How do I convert RGB to HEX?

Paste your RGB value into the converter above and it shows the HEX equivalent — along with every other format — instantly. For example, rgb(245, 158, 11) becomes #f59e0b.

What is RGB rgb(245, 158, 11) in HEX?

rgb(245, 158, 11) in HEX is #f59e0b.

Is my color sent to a server?

No. Every conversion runs locally in your browser using the canvas color parser and standard color math, so nothing you enter is uploaded.