RGB to HEX: #EC4899

Also known as: Tailwind v3 pink-500

Result

rgb(236 72 153) → #EC4899

Values are shown at full precision, so converting back gives exactly #ec4899. 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 = 236 = 14×16 + 12 → EC
    G = 72 = 4×16 + 8 → 48
    B = 153 = 9×16 + 9 → 99
  2. 2. pairs → HEX

    EC 48 99 → #EC4899

All formats

HEX
#ec4899
RGB
rgb(236 72 153)
RGB (legacy)
rgb(236, 72, 153)
HSL
hsl(330.37 81.19% 60.39%) → hsl(330 81% 60%)
HWB
hwb(330 28% 7%)
OKLCH
oklch(0.656 0.212 354.3) · oklch(65.6% 0.212 354.3)
OKLab
oklab(0.656 0.211 -0.021)
Lab (D50)
lab(57.31 67.87 -7.12)
LCH (D50)
lch(57.31 68.24 354.01)
Display P3
color(display-p3 0.8551 0.3327 0.5918)
Linear sRGB
color(srgb-linear 0.8388 0.0648 0.3185)

Gamut: sRGB and Display P3

#EC4899 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.267 and Display P3 reaches 0.303; this color uses 79% of the sRGB chroma available.

CSS snippets

.element {
  color: #ec4899;
  color: rgb(236 72 153);
  color: hsl(330 81% 60%);
  color: oklch(0.656 0.212 354.3);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.656 0.212 354.3);
}
/* arbitrary values */
class="text-[#ec4899] bg-[oklch(0.656_0.212_354.3)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.8551 0.3327 0.5918); }
}

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

  • #FF5DAC · oklch(0.716 0.212 354.3) · ΔL +0.06
  • #D63187 · oklch(0.596 0.212 354.3) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?