RGB to HEX: #F87171

Also known as: Tailwind v3 red-400

Result

rgb(248 113 113) → #F87171

Values are shown at full precision, so converting back gives exactly #f87171. 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 = 248 = 15×16 + 8 → F8
    G = 113 = 7×16 + 1 → 71
    B = 113 = 7×16 + 1 → 71
  2. 2. pairs → HEX

    F8 71 71 → #F87171

All formats

HEX
#f87171
RGB
rgb(248 113 113)
RGB (legacy)
rgb(248, 113, 113)
HSL
hsl(0.00 90.60% 70.78%) → hsl(0 91% 71%)
HWB
hwb(0 44% 3%)
OKLCH
oklch(0.711 0.166 22.2) · oklch(71.1% 0.166 22.2)
OKLab
oklab(0.711 0.154 0.063)
Lab (D50)
lab(64.74 52.73 26.67)
LCH (D50)
lch(64.74 59.09 26.83)
Display P3
color(display-p3 0.9070 0.4741 0.4594)
Linear sRGB
color(srgb-linear 0.9387 0.1651 0.1651)

Gamut: sRGB and Display P3

#F87171 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.182 and Display P3 reaches 0.232; this color uses 91% of the sRGB chroma available.

CSS snippets

.element {
  color: #f87171;
  color: rgb(248 113 113);
  color: hsl(0 91% 71%);
  color: oklch(0.711 0.166 22.2);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.711 0.166 22.2);
}
/* arbitrary values */
class="text-[#f87171] bg-[oklch(0.711_0.166_22.2)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.9070 0.4741 0.4594); }
}

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

  • #FF8483 · oklch(0.771 0.166 22.2) · ΔL +0.06
  • #E35E5F · oklch(0.651 0.166 22.2) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?