HEX to RGB Converter

Paste a HEX value and get the exact RGB equivalent instantly — plus every other color format, a gamut check and one-click copy.

Gamut: srgb

Common HEXRGB values

Vivid Indigo#6366f1rgb(99 102 241)Details
Vivid Red#ef4444rgb(239 68 68)Details
Orange#f97316rgb(249 115 22)Details
Light Yellow#eab308rgb(234 179 8)Details
Vivid Green#22c55ergb(34 197 94)Details
Teal#14b8a6rgb(20 184 166)Details
Sky Blue#0ea5e9rgb(14 165 233)Details
Blue#3b82f6rgb(59 130 246)Details
Vivid Violet#8b5cf6rgb(139 92 246)Details
Vivid Pink#ec4899rgb(236 72 153)Details
Medium Gray#78716crgb(120 113 108)Details
Black#000000rgb(0 0 0)Details

The conversion, step by step

A HEX color is just RGB written in base 16. Each channel uses two hexadecimal digits covering 0–255, where the first digit is the sixteens place and the second is the ones place. So f1 is 15 × 16 + 1 = 241.

Modern CSS syntax

Prefer the space-separated form rgb(99 102 241) and rgb(99 102 241 / 0.8) for alpha. The legacy comma form and rgba() still work but are no longer needed.

When RGB is the wrong tool

RGB describes how a display emits light, not how a color looks. Averaging two RGB colors often produces a muddy midpoint. Convert to OKLCH before blending, generating ramps or building hover states.

Frequently asked questions

How do you convert HEX to RGB by hand?
Split the six digits into three pairs and read each pair as a base-16 number: #6366f1 becomes 63 = 99, 66 = 102, f1 = 241, so rgb(99 102 241). Three-digit HEX doubles each digit, so #6cf is #66ccff.
What about eight-digit HEX with alpha?
The last pair is alpha: #6366f1cc has alpha cc = 204, or 204/255 ≈ 0.8, giving rgb(99 102 241 / 0.8).
Should I still use rgb() in CSS?
Yes for plain values, and modern space-separated syntax rgb(99 102 241) is preferred over commas. For manipulation — lightening, darkening, hue shifting — convert to oklch() instead so the maths matches perception.

Related tools