Skip to content

Hex to RGB

Turn any hex color code into RGB values.

  • 100% Free
  • No Sign Up
  • Works in Your Browser

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