Hex to RGB Converter

Convert hex color codes to RGB, with HSL, OKLCH and CMYK values alongside.

Enter a valid Hex value, like #8B5CF6

  • RGB
  • HSL
  • OKLCH
  • CMYK

How hex to RGB conversion works

A hex code holds three numbers, one each for red, green and blue, written in base 16. Each pair of digits gives a value from 0 to 255:

#8B5CF6
R = 8B = 8 × 16 + 11 = 139
G = 5C = 5 × 16 + 12 = 92
B = F6 = 15 × 16 + 6 = 246

So #8B5CF6, Tailwind's violet-500, is rgb(139, 92, 246). Letters A to F stand for 10 to 15.

Common colors in RGB

ColorHexRGB
White#FFFFFFrgb(255, 255, 255)
Black#000000rgb(0, 0, 0)
Red#FF0000rgb(255, 0, 0)
Orange#FFA500rgb(255, 165, 0)
Yellow#FFFF00rgb(255, 255, 0)
Green#008000rgb(0, 128, 0)
Blue#0000FFrgb(0, 0, 255)
Purple#800080rgb(128, 0, 128)
Pink#FFC0CBrgb(255, 192, 203)
Gray#808080rgb(128, 128, 128)

Questions

How do I convert hex to RGB?

Paste the hex code above and the RGB value appears instantly. By hand, split the six digits into three pairs and turn each pair from base 16 into a number from 0 to 255. #8B5CF6 becomes 8B, 5C and F6, which is 139, 92 and 246.

What about three-digit hex codes like #FA0?

Each digit is doubled, so #FA0 is the same as #FFAA00. The converter accepts both short and full codes, with or without the #.

Are hex and RGB the same color?

Yes. A hex code is just RGB written in base 16, so converting between them never changes the color. Pick whichever format your code or design tool expects.

How do I add transparency?

Use rgb(139 92 246 / 50%) in modern CSS, or rgba(139, 92, 246, 0.5) in the older syntax. In hex, add two more digits for the alpha, like #8B5CF680 for about 50%.

More free tools

Landings
Landing Page Examples
Copyright © 2026. All rights reserved.