RGB to HEX: #800000

Also known as: CSS maroon

Result

rgb(128 0 0) → #800000

Values are shown at full precision, so converting back gives exactly #800000. 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 = 128 = 8×16 + 0 → 80
    G = 0 = 0×16 + 0 → 00
    B = 0 = 0×16 + 0 → 00
  2. 2. pairs → HEX

    80 00 00 → #800000

All formats

HEX
#800000
RGB
rgb(128 0 0)
RGB (legacy)
rgb(128, 0, 0)
HSL
hsl(0.00 100.00% 25.10%) → hsl(0 100% 25%)
HWB
hwb(0 0% 50%)
OKLCH
oklch(0.377 0.155 29.2) · oklch(37.7% 0.155 29.2)
OKLab
oklab(0.377 0.135 0.075)
Lab (D50)
lab(26.17 48.47 39.44)
LCH (D50)
lch(26.17 62.49 39.13)
Display P3
color(display-p3 0.4584 0.0798 0.0472)
Linear sRGB
color(srgb-linear 0.2159 0.0000 0.0000)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #800000;
  color: rgb(128 0 0);
  color: hsl(0 100% 25%);
  color: oklch(0.377 0.155 29.2);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.377 0.155 29.2);
}
/* arbitrary values */
class="text-[#800000] bg-[oklch(0.377_0.155_29.2)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4584 0.0798 0.0472); }
}

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

  • #941F16 · oklch(0.437 0.155 29.2) · ΔL +0.06
  • #6C0000 · oklch(0.317 0.155 29.2) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?