RGB to HEX: #9400D3

Also known as: CSS darkviolet

Result

rgb(148 0 211) → #9400D3

Values are shown at full precision, so converting back gives exactly #9400d3. 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 = 148 = 9×16 + 4 → 94
    G = 0 = 0×16 + 0 → 00
    B = 211 = 13×16 + 3 → D3
  2. 2. pairs → HEX

    94 00 D3 → #9400D3

All formats

HEX
#9400d3
RGB
rgb(148 0 211)
RGB (legacy)
rgb(148, 0, 211)
HSL
hsl(282.09 100.00% 41.37%) → hsl(282 100% 41%)
HWB
hwb(282 0% 17%)
OKLCH
oklch(0.515 0.261 309.8) · oklch(51.5% 0.261 309.8)
OKLab
oklab(0.515 0.167 -0.200)
Lab (D50)
lab(38.79 70.43 -71.24)
LCH (D50)
lch(38.79 100.18 314.67)
Display P3
color(display-p3 0.5307 0.0988 0.7967)
Linear sRGB
color(srgb-linear 0.2961 0.0000 0.6514)

Gamut: sRGB and Display P3

#9400D3 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.261 and Display P3 reaches 0.276; this color uses 100% of the sRGB chroma available.

CSS snippets

.element {
  color: #9400d3;
  color: rgb(148 0 211);
  color: hsl(282 100% 41%);
  color: oklch(0.515 0.261 309.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.515 0.261 309.8);
}
/* arbitrary values */
class="text-[#9400d3] bg-[oklch(0.515_0.261_309.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.5307 0.0988 0.7967); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #9400d3 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

  • #A72CE8 · oklch(0.575 0.261 309.8) · ΔL +0.06
  • #8200BE · oklch(0.455 0.261 309.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?