Yellow hex code

The hex code for yellow is #FFFF00, or rgb(255, 255, 0). CSS also accepts the keyword yellow.

#FFFF00
HEX#FFFF00
RGBrgb(255, 255, 0)
HSLhsl(60, 100%, 50%)
HSV / HSBhsv(60, 100%, 100%)
OKLCHoklch(96.8% 0.211 109.77)
CMYKcmyk(0%, 0%, 100%, 0%)
Short HEX#FF0
HEX, 50% opacity#FFFF0080
RGB, 50% opacityrgb(255 255 0 / 50%)
CSS nameyellow
Defined inHTML 4.01 (one of the original 16 color names)

About yellow

yellow (#FFFF00) is full red plus full green light, with no blue. It is one of the 16 HTML 4 color names.

It is so close to white in luminance that yellow text on a white background is almost unreadable. Use it as a background behind dark text instead. For warmer alternatives, CSS has gold (#FFD700) and orange (#FFA500).

Shades of yellow

Yellow is lighter than a usual 50 step, so it starts the scale and every other step is darker. The steps follow a lightness curve modeled on Tailwind CSS's default palette; build your own in the Tailwind color generator. For yellow mixed with white, black or gray in even steps, use the tint and shade generator.

50#FFFF00100#F1F3C7200#E4E67F300#D2D100400#B6B500500#A2A100600#858400700#6D6C00800#5A5900900#4B4A00950#2C2B00

Colors that go with yellow

Partner hues are picked on the OKLCH color wheel at a mid lightness, because yellow itself is very light.

Complementary: the opposite hue

#FFFF00#CCC3FF

Open in the palette generator · Compare the screen and painter's complements of yellow

Analogous: neighboring hues 30° either side

#FFFF00#FFBD00#7AED5D

Open in the palette generator · See analogous and monochromatic colors of yellow on three wheels

Triadic: three hues 120° apart

#FFFF00#70DCFF#FFABDA

Open in the palette generator

Split complementary: the two hues beside the complement

#FFFF00#A9CFFF#FAABFF

Open in the palette generator

Text on yellow

Black text on yellow: 19.56:1
TextRatioAA normalAA largeAAA normal
White1.07:1FailFailFail
Black19.56:1PassPassPass

Check other pairs in the color contrast checker.

Similar named colors

The CSS named colors closest to yellow, by deltaE OK distance.

greenyellow #ADFF2Fgold #FFD700khaki #F0E68Cpalegreen #98FB98palegoldenrod #EEE8AAchartreuse #7FFF00

See all 148 on the color names page.

Closest Tailwind CSS colors

yellow-300 v4: yellow-300, #FFDF20, deltaE OK 0.080

yellow-300 v3: yellow-300, #FDE047, deltaE OK 0.086

No default Tailwind color is a close match: the nearest are yellow-300 in v4 and yellow-300 in v3. Use an arbitrary value instead: bg-[#ffff00]. A deltaE OK of around 0.02 is roughly the smallest difference most people notice side by side. Browse every shade on the Tailwind CSS colors page.

Yellow with color vision deficiency

An approximation of how yellow may look with protanopia, deuteranopia and tritanopia (simulated with Machado, Oliveira and Fernandes, 2009), and with achromatopsia, shown as a gray of the same luminance.

protanopia #FFF400deuteranopia #FFFA31tritanopia #FFEED9achromatopsia #F7F7F7

Test a whole palette or image in the color blindness simulator.

Using yellow in code

.example {
  color: yellow;                 /* named color */
  background-color: #ffff00;  /* hex */
  border-color: rgb(255, 255, 0);
}

Frequently asked questions

What is the hex code for yellow?
#FFFF00, or #FF0 in short form. CSS also accepts the keyword yellow, which means the same color.
What is yellow in RGB?
rgb(255, 255, 0). In HSL it is hsl(60, 100%, 50%), and in OKLCH oklch(96.8% 0.211 109.77).
What text color goes on yellow?
Black text has the higher contrast on #FFFF00: 19.56:1, which meets AAA for all text. White text reaches 1.07:1.
What is the closest Tailwind color to yellow?
No default Tailwind color is a close match: the nearest are yellow-300 in v4 and yellow-300 in v3. Use an arbitrary value instead: bg-[#ffff00].
How do I make yellow transparent?
Add an alpha value. Half-transparent yellow is #FFFF0080 as 8-digit HEX (80 is 128 out of 255) or rgb(255 255 0 / 50%).