HEX to RGB converter

Paste a hex color code and get its RGB values right away, in modern CSS syntax and in the classic comma form.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Enter the colorType or paste the value in the input.
  2. Copy the resultThe converted value is at the top of the list.
  3. Explore moreOther formats, contrast and shades are below.

From #RRGGBB to red, green and blue

A hex code is just three numbers from 0 to 255 written in base 16: in #0D6B57 the pairs 0D, 6B and 57 are red 13, green 107 and blue 87. Short codes like #fa0 double each digit, and eight digit codes add an alpha channel, so #0D6B5780 is the same color at about 50 percent opacity.

The result is shown as rgb(13 107 87), the modern CSS syntax, and as rgb(13, 107, 87) or rgba() for older code, design tools and Android or iOS color APIs that expect separate numbers.

Also useful

HSL, OKLCH and CMYK values are listed below, together with a contrast check and shades, in case you are building a palette.

Frequently asked questions

How do I convert a hex code with transparency?

Use 8 digits, for example #0D6B5780. The last two digits are the alpha value.

Which color formats can I type?

Anything valid in CSS: HEX with 3, 4, 6 or 8 digits, rgb(), hsl(), hwb(), lab(), oklch() and color names.

Is the CMYK value exact for printing?

It is a simple conversion without a printer profile. For professional print use the CMYK values from your print shop's profile.

What contrast ratio do I need?

WCAG AA asks for 4.5:1 for normal text and 3:1 for large text and interface parts.

Why does OKLCH matter?

It matches how people see lightness, so palettes and gradients made in OKLCH look even.