RGB to HEX: #8B5CF6

Also known as: Tailwind v3 violet-500

Result

rgb(139 92 246) → #8B5CF6

Values are shown at full precision, so converting back gives exactly #8b5cf6. The rounded form is what you normally paste into CSS.

Step-by-step math

Every number below is computed from the input, nothing is looked up.

  1. 1. base 10 → base 16

    R = 139 = 8×16 + 11 → 8B
    G = 92 = 5×16 + 12 → 5C
    B = 246 = 15×16 + 6 → F6
  2. 2. pairs → HEX

    8B 5C F6 → #8B5CF6

All formats

HEX
#8b5cf6
RGB
rgb(139 92 246)
RGB (legacy)
rgb(139, 92, 246)
HSL
hsl(258.31 89.53% 66.27%) → hsl(258 90% 66%)
HWB
hwb(258 36% 4%)
OKLCH
oklch(0.606 0.219 292.7) · oklch(60.6% 0.219 292.7)
OKLab
oklab(0.606 0.085 -0.202)
Lab (D50)
lab(50.69 45.85 -71.80)
LCH (D50)
lch(50.69 85.19 302.56)
Display P3
color(display-p3 0.5183 0.3688 0.9315)
Linear sRGB
color(srgb-linear 0.2582 0.1070 0.9216)

Gamut: sRGB and Display P3

#8B5CF6 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.236 and Display P3 reaches 0.255; this color uses 93% of the sRGB chroma available.

CSS snippets

.element {
  color: #8b5cf6;
  color: rgb(139 92 246);
  color: hsl(258 90% 66%);
  color: oklch(0.606 0.219 292.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.606 0.219 292.7);
}
/* arbitrary values */
class="text-[#8b5cf6] bg-[oklch(0.606_0.219_292.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.5183 0.3688 0.9315); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #8b5cf6 calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #9C70FF · oklch(0.666 0.219 292.7) · ΔL +0.06
  • #7A48E1 · oklch(0.546 0.219 292.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?