How do I convert HEX to RGB?
Split a six-digit HEX code into three pairs after the hash. Each pair is hexadecimal (base 16): convert 25 to 37, 63 to 99, and eb to 235 for #2563eb, giving rgb(37, 99, 235).
To convert HEX to RGB, split the six-digit code into three pairs and read each pair as a base-16 number from 0 to 255: #3B82F6 = rgb(59, 130, 246). Paste any HEX code below to convert it instantly.
Convert HEX, RGB and HSL in one place. Paste a six- or eight-digit HEX code or an rgb() value, preview the swatch with alpha, and copy each format.
Take #2563eb and read the three pairs: 25, 63, and eb. Each pair is base 16, so 25 → 2×16 + 5 = 37, 63 → 6×16 + 3 = 99, and eb → 14×16 + 11 = 235. That gives rgb(37, 99, 235).
#2563ebrgb(37, 99, 235)hsl(221, 83%, 53%)| Color | Input HEX | HEX | RGB | HSL |
|---|---|---|---|---|
| White | #ffffff | #ffffff | rgb(255, 255, 255) | hsl(0, 0%, 100%) |
| Black | #000000 | #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) |
| Red | #ef4444 | #ef4444 | rgb(239, 68, 68) | hsl(0, 84%, 60%) |
| Blue | #2563eb | #2563eb | rgb(37, 99, 235) | hsl(221, 83%, 53%) |
| Green | #22c55e | #22c55e | rgb(34, 197, 94) | hsl(142, 71%, 45%) |
| 50% transparent black | #00000080 | #00000080 | rgba(0, 0, 0, 0.502) | hsla(0, 0%, 0%, 0.502) |
Standard HEX uses six digits for red, green and blue. Add two more digits for alpha: #00000080 is black at roughly 50% opacity because 80 hex equals 128, and 128÷255 ≈ 0.502. The preview checkerboard behind the swatch shows transparency. In CSS you can paste the same eight-digit HEX or use the copied rgba() value.
Split a six-digit HEX code into three pairs after the hash. Each pair is hexadecimal (base 16): convert 25 to 37, 63 to 99, and eb to 235 for #2563eb, giving rgb(37, 99, 235).
An eight-digit HEX adds two alpha digits at the end, such as #2563eb80 where 80 is the opacity in hex (128 of 255, about 50%). CSS accepts #RRGGBBAA alongside rgb() and rgba().
Both work in modern browsers. RGB maps directly from HEX. HSL separates hue, saturation and lightness, which helps when you lighten a brand color without shifting its hue.
Drop the copied values into palettes or check contrast before you ship UI. Need a see-through version? Use the HEX to RGBA converter or look up the code in the hex opacity chart.