HEX to RGB: #228B22

Also known as: CSS forestgreen

Result

#228B22 → rgb(34 139 34)

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

    #228B22 → 22 | 8B | 22
  2. 2. base 16 → base 10

    R = 22₁₆ = 2×16 + 2 = 34
    G = 8B₁₆ = 8×16 + 11 = 139
    B = 22₁₆ = 2×16 + 2 = 34
  3. 3. RGB

    rgb(34 139 34)

All formats

HEX
#228b22
RGB
rgb(34 139 34)
RGB (legacy)
rgb(34, 139, 34)
HSL
hsl(120.00 60.69% 33.92%) → hsl(120 61% 34%)
HWB
hwb(120 13% 45%)
OKLCH
oklch(0.558 0.169 142.9) · oklch(55.8% 0.169 142.9)
OKLab
oklab(0.558 -0.135 0.102)
Lab (D50)
lab(50.64 -45.72 44.03)
LCH (D50)
lch(50.64 63.47 136.08)
Display P3
color(display-p3 0.2694 0.5372 0.2014)
Linear sRGB
color(srgb-linear 0.0160 0.2582 0.0160)

Gamut: sRGB and Display P3

#228B22 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.187 and Display P3 reaches 0.226; this color uses 90% of the sRGB chroma available.

CSS snippets

.element {
  color: #228b22;
  color: rgb(34 139 34);
  color: hsl(120 61% 34%);
  color: oklch(0.558 0.169 142.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.558 0.169 142.9);
}
/* arbitrary values */
class="text-[#228b22] bg-[oklch(0.558_0.169_142.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2694 0.5372 0.2014); }
}

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

  • #399E37 · oklch(0.618 0.169 142.9) · ΔL +0.06
  • #007904 · oklch(0.498 0.169 142.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?