Convert any hex color code to RGB values instantly. Understand the hex-to-RGB math and get ready-to-paste rgb() and rgba() values for your CSS.
Controls transparency - 0% is fully transparent, 100% is fully opaque
Solid (100%)
With Opacity (100%)
Complementary colors are opposite each other on the color wheel, creating high contrast and vibrant looks. Perfect for making elements stand out.
Click on the wheel to change hue
A hex color code is a compact way to write a color as a six-digit hexadecimal string, like #3B82F6. RGB describes the same color as three decimal numbers — the amount of red, green, and blue light from 0 to 255. Converting from hex to RGB is useful whenever you need the rgb() or rgba() form in CSS, for example to add an alpha channel for transparency.
Enter or pick a color and the converter instantly shows its RGB values alongside HEX, HSL, and other formats, each ready to copy into your stylesheet.
A hex color is just three pairs of hexadecimal digits, one pair per channel, in the order red, green, blue. Hexadecimal is base-16, so each pair represents a number from 00 to FF — that is 0 to 255 in decimal. To convert a pair, multiply the first digit by 16 and add the second:
#3B82F6 splits into 3B, 82, F6.So #3B82F6 becomes rgb(59, 130, 246). The letters A–F stand for 10–15. Shorthand three-digit hex like #39F is expanded by doubling each digit (#3399FF) before converting.
Hex and RGB describe identical colors, so the choice is about convenience. RGB shines when you want an alpha channel: rgba(59, 130, 246, 0.5) gives a 50% transparent blue, something plain six-digit hex cannot express. RGB values are also easier to manipulate in JavaScript, since each channel is already a number you can add to or interpolate between — handy for animations, gradients, and generated themes.
Drop the converted value straight into any color property: color: rgb(59, 130, 246); or background: rgba(59, 130, 246, 0.5);. Modern CSS also accepts a space-separated syntax, rgb(59 130 246 / 50%), which behaves the same way. Keep your most-used colors as CSS custom properties so you only convert each one once.
It helps to remember that converting between hex and RGB never changes the color itself — both notations point at the exact same red, green, and blue intensities, just written differently. That means you can move back and forth freely: author in whichever format is convenient, then convert to the other when a tool, teammate, or API expects it. Because the round trip is lossless, #3B82F6 and rgb(59, 130, 246) will always render as the identical shade of blue.
Split the six-digit code into three pairs (red, green, blue). Convert each two-digit hexadecimal pair to decimal by multiplying the first digit by 16 and adding the second. For example, FF = (15 × 16) + 15 = 255.
It converts to rgb(59, 130, 246): 3B is 59, 82 is 130, and F6 is 246. The tool shows this conversion automatically along with other formats.
Expand the shorthand first by doubling each digit. For example #39F becomes #3399FF, which then converts to rgb(51, 153, 255).
RGB lets you add an alpha channel for transparency with rgba(), and the numeric channels are easier to manipulate in JavaScript for gradients, animations, and dynamically generated colors. Hex and RGB otherwise describe the exact same color.