Boneyard Tools

HEX to RGB Converter

Paste a HEX color and read its rgb() string the moment you type. The converter accepts full six-digit codes, three-digit shorthand, and values with or without the leading # sign, then shows the same color as HEX, RGB and HSL side by side. Everything is computed in your browser, so the colors you test stay on your machine.

How to convert HEX to RGB

  1. Type or paste your HEX color into the input, for example #ff0000 or ff0000.
  2. Or click the color swatch on the left to pick a shade visually.
  3. Watch the swatch preview and the rgb() value update live as you edit.
  4. Compare the HEX, RGB and HSL cards below to see all three formats at once.
  5. Press Copy next to the RGB output and paste it into your CSS or design tool.

Examples

Pure red

#ff0000
rgb(255, 0, 0)

Tailwind blue-500

#3b82f6
rgb(59, 130, 246)

Green shorthand expands to six digits

#0f0
rgb(0, 255, 0)

Frequently asked questions

What is a HEX color code?

A HEX code is a six-digit hexadecimal number like #3b82f6. The three pairs encode red, green and blue, each running from 00 to ff, which is 0 to 255 in decimal.

What is an RGB color?

RGB describes a color by its red, green and blue channels, each from 0 to 255. In CSS it is written as rgb(59, 130, 246), and browsers mix those three channels to produce the final shade.

Does it support 3-digit shorthand like #f00?

Yes. Shorthand HEX is expanded by doubling each digit, so #f00 becomes #ff0000 and converts to rgb(255, 0, 0). The digit 0f0 becomes 00ff00, giving rgb(0, 255, 0).

Do I need to type the # sign?

No. The parser strips a leading # if present, so ff0000 and #ff0000 give the same result. This makes it easy to paste raw values copied from spreadsheets or config files.

What happens if I enter an invalid code?

If the value is not three or six valid hex digits, the tool shows an Invalid HEX color message instead of a result. Fix the length or remove any stray characters and it will update again.

Where do I use the RGB value?

Mostly in CSS, where rgb() is a standard color format, and in design tools like Figma or Sketch that accept red, green and blue channel values directly.

What about alpha or transparency?

This tool converts opaque colors only. For transparency, add an alpha channel yourself using rgba(), for example rgba(255, 0, 0, 0.5), where the last value is the opacity from 0 to 1.

Can I see the HSL value too?

Yes. Below the main result the tool shows a small grid with the HEX, RGB and HSL forms of the current color, so you can grab whichever notation your project needs.

Is my color data uploaded anywhere?

No. The conversion runs entirely in your browser using a small pure function, so the colors you enter never leave your device or reach a server.

Learn more

Related tools