RGB to HEX: #047857

Also known as: Tailwind v3 emerald-700

Result

rgb(4 120 87) → #047857

Values are shown at full precision, so converting back gives exactly #047857. 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 = 4 = 0×16 + 4 → 04
    G = 120 = 7×16 + 8 → 78
    B = 87 = 5×16 + 7 → 57
  2. 2. pairs → HEX

    04 78 57 → #047857

All formats

HEX
#047857
RGB
rgb(4 120 87)
RGB (legacy)
rgb(4, 120, 87)
HSL
hsl(162.93 93.55% 24.31%) → hsl(163 94% 24%)
HWB
hwb(163 2% 53%)
OKLCH
oklch(0.508 0.105 165.6) · oklch(50.8% 0.105 165.6)
OKLab
oklab(0.508 -0.102 0.026)
Lab (D50)
lab(44.33 -36.23 9.79)
LCH (D50)
lch(44.33 37.52 164.88)
Display P3
color(display-p3 0.2039 0.4633 0.3499)
Linear sRGB
color(srgb-linear 0.0012 0.1878 0.0953)

Gamut: sRGB and Display P3

#047857 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.106 and Display P3 reaches 0.145; this color uses 99% of the sRGB chroma available.

CSS snippets

.element {
  color: #047857;
  color: rgb(4 120 87);
  color: hsl(163 94% 24%);
  color: oklch(0.508 0.105 165.6);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.508 0.105 165.6);
}
/* arbitrary values */
class="text-[#047857] bg-[oklch(0.508_0.105_165.6)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2039 0.4633 0.3499); }
}

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

  • #278A68 · oklch(0.568 0.105 165.6) · ΔL +0.06
  • #006647 · oklch(0.448 0.105 165.6) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?