Skip to content

Yellow Color

Pure yellow #FFFF00 — full red plus full green light.

HEX
#FFFF00
RGB
rgb(255, 255, 0)
HSL
hsl(60, 100%, 50%)
HSV
hsv(60, 100%, 100%)
CMYKapproximation
cmyk(0%, 0%, 100%, 0%)
CSS name
yellow

Open yellow in the color picker to adjust it or copy other formats.

About yellow

#FFFF00 is the CSS named color yellow. On a screen, yellow is made by mixing red and green light at full intensity, with no blue. It is the brightest of all fully saturated colors.

That brightness is also its limitation: yellow on white has a contrast ratio close to 1:1 and is nearly invisible. Paired with black, on the other hand, it gives one of the highest-contrast combinations there is — the reason warning signs and highlighters use it.

#FFFF00 is the value of the CSS named color yellow, defined in the CSS Color specification and identical in every browser.

Other colors called yellow

  • Light yellow (CSS) #FFFFE0A barely-there yellow for backgrounds.
  • Gold (CSS) #FFD700A warmer, slightly orange yellow.

Yellow shades and tints

Shades mix yellow with black, tints mix it with white — useful for hover states, borders and backgrounds. Click a swatch to copy its HEX code.

Colors that go with yellow

Color harmonies based on the hue of #FFFF00: its complement on the opposite side of the color wheel, its analogous neighbours and its triadic partners.

Yellow contrast and readability

On a yellow background, black text reads best (19.55:1). Here is how yellow works as a text color:

#FFFF00 on white

1.07:1

Normal text sample

Large text

  • AA normal text (4.5:1)Fail
  • AA large text (3:1)Fail
  • AAA normal text (7:1)Fail
  • AAA large text (4.5:1)Fail

#FFFF00 on black

19.55:1

Normal text sample

Large text

  • AA normal text (4.5:1)Pass
  • AA large text (3:1)Pass
  • AAA normal text (7:1)Pass
  • AAA large text (4.5:1)Pass

Use yellow as a background or highlight with black text. For yellow-looking text on white, choose a much darker, more golden tone and check the contrast first.

Using yellow in CSS and HTML

CSS custom property
:root {
  --color-yellow: #FFFF00;
}

.highlight {
  background-color: var(--color-yellow);
}
Background and text color
.banner {
  background-color: yellow;
  color: #000000;
}

.label {
  color: #FFFF00;
  border: 2px solid rgb(255, 255, 0);
}
Inline style in HTML
<p style="background-color: #FFFF00; color: #000000;">
  Yellow background
</p>

Yellow color FAQ

What is the HEX code for yellow?
Yellow is #FFFF00 in HEX and rgb(255, 255, 0) in RGB. It is also the CSS named color yellow, so color: yellow and color: #ffff00 give exactly the same result.
What is yellow in CMYK?
Approximately 0%, 0%, 100%, 0% (cyan, magenta, yellow, black). This is the standard profile-free conversion of #FFFF00; for professional print, check the value against your printer's color profile.
What colors go with yellow?
Its complementary color is #0000FF, and #FF8000 and #80FF00 sit next to it on the color wheel as analogous colors. White, black and gray always work as neutral partners; the matching colors above show more combinations.
Should I use black or white text on yellow?
Black text: it has a contrast ratio of 19.55:1 on #FFFF00, which meets WCAG AAA for normal text.