RGB to HEX: #FFD700

Also known as: CSS gold

Result

rgb(255 215 0) → #FFD700

Values are shown at full precision, so converting back gives exactly #ffd700. 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 = 255 = 15×16 + 15 → FF
    G = 215 = 13×16 + 7 → D7
    B = 0 = 0×16 + 0 → 00
  2. 2. pairs → HEX

    FF D7 00 → #FFD700

All formats

HEX
#ffd700
RGB
rgb(255 215 0)
RGB (legacy)
rgb(255, 215, 0)
HSL
hsl(50.59 100.00% 50.00%) → hsl(51 100% 50%)
HWB
hwb(51 0% 0%)
OKLCH
oklch(0.887 0.182 95.3) · oklch(88.7% 0.182 95.3)
OKLab
oklab(0.887 -0.017 0.181)
Lab (D50)
lab(87.47 2.91 86.55)
LCH (D50)
lch(87.47 86.60 88.07)
Display P3
color(display-p3 0.9746 0.8490 0.2855)
Linear sRGB
color(srgb-linear 1.0000 0.6795 0.0000)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #ffd700;
  color: rgb(255 215 0);
  color: hsl(51 100% 50%);
  color: oklch(0.887 0.182 95.3);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.887 0.182 95.3);
}
/* arbitrary values */
class="text-[#ffd700] bg-[oklch(0.887_0.182_95.3)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.9746 0.8490 0.2855); }
}

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

  • #FFEB38 · oklch(0.947 0.182 95.3) · ΔL +0.06
  • #EBC300 · oklch(0.827 0.182 95.3) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?