HEX to HSL: #9CA3AF

Also known as: Tailwind v3 gray-400

Result

#9CA3AF → hsl(218 11% 65%)

Values are shown at full precision, so converting back gives exactly #9ca3af. 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.6118
    G = 0.6392
    B = 0.6863
  2. 2. max, min, Δ

    max = 0.6863
    min = 0.6118
    Δ = max − min = 0.0745
  3. 3. L

    L = (max + min) / 2 = 0.6490 = 64.90%
  4. 4. S

    S = Δ / (1 − |2L − 1|) = 0.1061 = 10.61%
  5. 5. H

    max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.6118 − 0.6392) / 0.0745 + 4) = 217.89°
  6. 6. HSL

    hsl(217.89 10.61% 64.90%)

All formats

HEX
#9ca3af
RGB
rgb(156 163 175)
RGB (legacy)
rgb(156, 163, 175)
HSL
hsl(217.89 10.61% 64.90%) → hsl(218 11% 65%)
HWB
hwb(218 61% 31%)
OKLCH
oklch(0.714 0.019 261.3) · oklch(71.4% 0.019 261.3)
OKLab
oklab(0.714 -0.003 -0.019)
Lab (D50)
lab(66.71 -0.75 -7.14)
LCH (D50)
lch(66.71 7.18 264.00)
Display P3
color(display-p3 0.6168 0.6383 0.6818)
Linear sRGB
color(srgb-linear 0.3325 0.3663 0.4287)

Gamut: sRGB and Display P3

#9CA3AF is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.149 and Display P3 reaches 0.162; this color uses 13% of the sRGB chroma available.

CSS snippets

.element {
  color: #9ca3af;
  color: rgb(156 163 175);
  color: hsl(218 11% 65%);
  color: oklch(0.714 0.019 261.3);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.714 0.019 261.3);
}
/* arbitrary values */
class="text-[#9ca3af] bg-[oklch(0.714_0.019_261.3)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.6168 0.6383 0.6818); }
}

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

  • #AFB6C2 · oklch(0.774 0.019 261.3) · ΔL +0.06
  • #8A919C · oklch(0.654 0.019 261.3) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?