HEX to HSL: #F9FAFB

Also known as: Tailwind gray-50, Tailwind v3 gray-50

Result

#F9FAFB → hsl(210 20% 98%)

Values are shown at full precision, so converting back gives exactly #f9fafb. 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. RGB ÷ 255

    R = 0.9765
    G = 0.9804
    B = 0.9843
  2. 2. max, min, Δ

    max = 0.9843
    min = 0.9765
    Δ = max − min = 0.0078
  3. 3. L

    L = (max + min) / 2 = 0.9804 = 98.04%
  4. 4. S

    S = Δ / (1 − |2L − 1|) = 0.2000 = 20.00%
  5. 5. H

    max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.9765 − 0.9804) / 0.0078 + 4) = 210.00°
  6. 6. HSL

    hsl(210.00 20.00% 98.04%)

All formats

HEX
#f9fafb
RGB
rgb(249 250 251)
RGB (legacy)
rgb(249, 250, 251)
HSL
hsl(210.00 20.00% 98.04%) → hsl(210 20% 98%)
HWB
hwb(210 98% 2%)
OKLCH
oklch(0.985 0.002 247.8) · oklch(98.5% 0.002 247.8)
OKLab
oklab(0.985 -0.001 -0.002)
Lab (D50)
lab(98.22 -0.21 -0.60)
LCH (D50)
lch(98.22 0.64 250.72)
Display P3
color(display-p3 0.9772 0.9803 0.9839)
Linear sRGB
color(srgb-linear 0.9473 0.9560 0.9647)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #f9fafb;
  color: rgb(249 250 251);
  color: hsl(210 20% 98%);
  color: oklch(0.985 0.002 247.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.985 0.002 247.8);
}
/* arbitrary values */
class="text-[#f9fafb] bg-[oklch(0.985_0.002_247.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.9772 0.9803 0.9839); }
}

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

  • #FEFFFF · oklch(1.000 0.002 247.8) · ΔL +0.06
  • #E5E6E7 · oklch(0.925 0.002 247.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?