Boneyard Tools

RGB to HEX Converter

Turn any RGB color into a hex code in real time. Type rgb(59, 130, 246) or a plain 59,130,246 triple and copy the result. Everything runs in your browser.

How to convert RGB to HEX

  1. Enter your RGB color as rgb(255, 0, 0) or as a plain 255,0,0 triple.
  2. Read the matching hex code shown next to a live color swatch.
  3. Copy the hex value and paste it into your CSS or design tool.

Examples

Pure red

rgb(255, 0, 0)
#ff0000

Tailwind blue-500

rgb(59, 130, 246)
#3b82f6

Frequently asked questions

What is the difference between RGB and HEX?

They describe the same color in different notations. RGB lists three channels (red, green, blue) from 0 to 255, while HEX packs those same three channels into a six-digit hexadecimal string like #3b82f6.

What input formats does this accept?

Both the CSS rgb(...) form and a plain comma-separated triple work. For example rgb(255, 0, 0) and 255,0,0 produce the same #ff0000.

What range do RGB values use?

Each channel must be a whole number from 0 to 255, where 0 is none of that color and 255 is full intensity. Values outside 0 to 255 are rejected as invalid.

How do I use the hex code in CSS?

Paste the hex value directly into any color property, such as color: #3b82f6 or background: #ff0000. Hex codes work everywhere CSS expects a color.

Is my color data uploaded anywhere?

No. The conversion happens entirely in your browser, so the colors you enter never leave your device.

Why are letters in the hex code lowercase?

Hex colors are case-insensitive, so #FF0000 and #ff0000 are identical. This tool outputs lowercase by convention, which is the most common style in CSS.

Related tools