HEX to RGB: #0F172A

Also known as: Tailwind v3 slate-900

Result

#0F172A → rgb(15 23 42)

Values are shown at full precision, so converting back gives exactly #0f172a. 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. HEX → pairs

    #0F172A → 0F | 17 | 2A
  2. 2. base 16 → base 10

    R = 0F₁₆ = 0×16 + 15 = 15
    G = 17₁₆ = 1×16 + 7 = 23
    B = 2A₁₆ = 2×16 + 10 = 42
  3. 3. RGB

    rgb(15 23 42)

All formats

HEX
#0f172a
RGB
rgb(15 23 42)
RGB (legacy)
rgb(15, 23, 42)
HSL
hsl(222.22 47.37% 11.18%) → hsl(222 47% 11%)
HWB
hwb(222 6% 84%)
OKLCH
oklch(0.208 0.040 265.8) · oklch(20.8% 0.040 265.8)
OKLab
oklab(0.208 -0.003 -0.040)
Lab (D50)
lab(7.78 1.59 -14.30)
LCH (D50)
lch(7.78 14.38 276.34)
Display P3
color(display-p3 0.0653 0.0893 0.1592)
Linear sRGB
color(srgb-linear 0.0048 0.0086 0.0232)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #0f172a;
  color: rgb(15 23 42);
  color: hsl(222 47% 11%);
  color: oklch(0.208 0.040 265.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.208 0.040 265.8);
}
/* arbitrary values */
class="text-[#0f172a] bg-[oklch(0.208_0.040_265.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.0653 0.0893 0.1592); }
}

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

  • #1D2539 · oklch(0.268 0.040 265.8) · ΔL +0.06
  • #04091B · oklch(0.148 0.040 265.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?