Skip to content

Hex to RGB

Turn any hex color code into RGB values.

How to use the hex to RGB

Three steps, all in your browser.

  1. 1

    Enter a color

    Type or paste a code in any format, or use the picker.

  2. 2

    See every format

    The converted values update as you type, in every format at once.

  3. 3

    Copy the codes

    Copy any color code in one click, or share the page link.

Hex to RGB: what to know

Hex to RGB converts a hexadecimal color code into its red, green and blue values. A hex code is just three numbers written in base 16: #DB2777 splits into DB, 27 and 77, which are 219, 39 and 119 in base 10, so the color is rgb(219, 39, 119).

Each pair runs from 00 (0) to FF (255), which is why every channel in RGB goes from 0 to 255 and why there are 256 × 256 × 256 = 16,777,216 possible hex colors. The converter also accepts the shorthand three-digit form (#F0C means #FF00CC) and eight-digit codes whose last pair is the alpha (opacity) channel.

The result is shown both as numbers and as a CSS rgb() value you can paste into a stylesheet, with the modern space-separated form for colors with transparency.

Popular uses

  • Using a hex brand color in software that asks for RGB
  • Setting colors in code, LED controllers or game engines
  • Adding transparency to a hex color with rgb() and alpha
  • Learning how hex codes are built

Tips for the best result

  • Hex codes aren't case-sensitive: #db2777 and #DB2777 are the same color.
  • To make a hex color 50% transparent in CSS, add 80 to the end (#DB277780) or use rgb() with / 0.5.
  • If a code has five or seven digits it's a typo; check for a missing or extra character.

Read how JustYourPalette works, browse named colors and curated palettes, and see our privacy details. Colors you enter and images you open are processed in your browser and are never sent to our server.

Frequently asked questions

Split the six digits into three pairs and convert each pair from base 16 to base 10. For #DB2777: DB = 13×16 + 11 = 219, 27 = 39, 77 = 119, so the color is rgb(219, 39, 119).

It's shorthand: each digit is doubled, so #F0C is the same color as #FF00CC. Four-digit codes work the same way, with the fourth digit for transparency.

They're the alpha channel (opacity), from 00 (fully transparent) to FF (fully opaque). #DB277780 is the same pink at about 50% opacity, rgb(219 39 119 / 0.5).

No. Every tool runs in your browser, so the colors you enter and any image you open are processed on your device and are not sent to our server or stored. Reloading or closing the page clears them.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

Yes. Colors and color codes aren't owned by anyone, so you can use anything you make here in personal and commercial projects. Brand colors may still be protected as part of a trademark.