Free Accessible CSS Gradient Generator

← All Colors
#FFFFFF White

White Hex Code #FFFFFF

White is pure white, the lightest color a screen can show, with the hex code #FFFFFF. In RGB it is 255, 255, 255, and in HSL it is 0°, 0%, 100%. It is one of the 148 named colors in CSS, so you can write “white” instead of the hex code.

HEX
#FFFFFF
RGB
rgb(255, 255, 255)
HSL
hsl(0, 0%, 100%)
HSV
hsv(0°, 0%, 100%)
CMYK
cmyk(0%, 0%, 0%, 0%)
CSS name
white

CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.

About White

On a white background White has a contrast ratio of 1.00:1 (Fail), and on black 21.00:1 (AAA). Black text is the better choice on top of it.

It has almost no hue of its own, so it pairs comfortably with almost any accent color.

Near-white colors work well as backgrounds and surfaces. Their slight tint feels softer than pure white, which can look harsh across a large screen.

Good to know: White (#ffffff) has a relative luminance of 1 and gives the highest possible contrast against black, 21:1. On large screens a pure white background can feel harsh, which is why off-whites such as whitesmoke (#f5f5f5) and ivory (#fffff0) are popular.

Shades and tints of White

Tints mix White with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.

Pairing White with an accent color

White has almost no hue of its own, so color schemes built from it would all look the same. A neutral works best as a background or text color beside an accent. This is how six accent colors contrast with White.

White contrast and accessibility

WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how White scores against white and black.

Contrast of White with white and black
AgainstRatioAA normalAA largeAAA normalAAA large
White (#ffffff) 1.00:1 ✕ Fail ✕ Fail ✕ Fail ✕ Fail
Black (#000000) 21.00:1 ✓ Pass ✓ Pass ✓ Pass ✓ Pass
Aa White text on White1.00:1
Aa Black text on White21.00:1

White and color blindness

These are approximate previews of how White can look with the main types of color vision deficiency.

Protanopia #FFFFFF

White looks almost the same.

Deuteranopia #FFFFFF

White looks almost the same.

Tritanopia #FFFFFF

White looks almost the same.

Achromatopsia #FFFFFF

White looks almost the same.

Gradients with White

Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.

White to a darker shade

background: linear-gradient(135deg, #ffffff 0%, #666666 100%);

White to Dark Orchid

background: linear-gradient(135deg, #ffffff 0%, #9932cc 100%);

White to Crimson

background: linear-gradient(135deg, #ffffff 0%, #dc143c 100%);

Colors similar to White

How each close match differs from White.

More white & cream colors →

Use White in code

CSS
.element {
  color: #ffffff;
  background-color: #ffffff;
  border-color: white;   /* white is a valid CSS color name */
}
CSS variable
:root {
  --color-white: #ffffff;
}
Tailwind
<!-- Tailwind arbitrary values -->
<div class="bg-[#ffffff] text-[#ffffff] border-[#ffffff]"></div>

/* Tailwind v4 theme color */
@theme {
  --color-white: #ffffff;
}

White questions

What is the hex code for White?

The hex code for White is #FFFFFF. In RGB that is rgb(255, 255, 255), and in HSL it is hsl(0, 0%, 100%).

Which colors go well with White?

White is a neutral color with almost no hue of its own, so it has no true complement and pairs with nearly any accent. The accents that contrast most strongly against it are Dark Orchid (5.70:1), Crimson (4.99:1), Royal Blue (4.85:1).

Should I use white or black text on White?

Black text. It has a contrast ratio of 21.00:1 against White, which is WCAG AAA. The other option scores 1.00:1.

Is White accessible as a text color on white?

No. White on white scores 1.00:1, which is below the WCAG minimum of 3:1 even for large text.

What are darker and lighter shades of White?

Mixing White with black gives #CCCCCC, #999999, #666666, #333333 (20% to 80% black). Mixing it with white gives #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF (20% to 80% white).

More color tools