HEX to RGB: #0F172B

Also known as: Tailwind slate-900

Result

#0F172B → rgb(15 23 43)

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

    #0F172B → 0F | 17 | 2B
  2. 2. base 16 → base 10

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

    rgb(15 23 43)

All formats

HEX
#0f172b
RGB
rgb(15 23 43)
RGB (legacy)
rgb(15, 23, 43)
HSL
hsl(222.86 48.28% 11.37%) → hsl(223 48% 11%)
HWB
hwb(223 6% 83%)
OKLCH
oklch(0.208 0.042 266.4) · oklch(20.8% 0.042 266.4)
OKLab
oklab(0.208 -0.003 -0.042)
Lab (D50)
lab(7.83 1.92 -14.95)
LCH (D50)
lch(7.83 15.07 277.33)
Display P3
color(display-p3 0.0653 0.0893 0.1629)
Linear sRGB
color(srgb-linear 0.0048 0.0086 0.0242)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #0f172b;
  color: rgb(15 23 43);
  color: hsl(223 48% 11%);
  color: oklch(0.208 0.042 266.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.208 0.042 266.4);
}
/* arbitrary values */
class="text-[#0f172b] bg-[oklch(0.208_0.042_266.4)]"

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

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

  • #1D253B · oklch(0.268 0.042 266.4) · ΔL +0.06
  • #04091C · oklch(0.148 0.042 266.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?