Skip to content
Let’s chat ↗

THE COLOR LIBRARY / Neutral

White color codes.

The CSS white color code is #FFFFFF. Its RGB value is rgb(255, 255, 255) and its HSL value is hsl(0, 0%, 100%). Start with the exact reference, then choose a shade for the job.

A color name describes a family in everyday language. This page uses the standardized CSS keyword as its reference; your brand’s white may be different.

Explore the shades ↓
CSS / whiteWhite#FFFFFF

COPY. PASTE. MAKE IT YOURS.

White in HEX, RGB, and HSL

HEX#FFFFFF
RGBrgb(255, 255, 255)
HSLhsl(0, 0%, 100%)

HEX and RGB encode the same sRGB reference. HSL is calculated from it and rounded to two decimals for display. These are screen color values, not a CMYK print specification.

ONE COLOR. DIFFERENT ROLES.

Explore white tints and shades

Select a swatch to see its codes and compare text contrast.

UI COLOR SPECIMEN

Make the next step clear.

A label, a surface, and room to breathe.

Selected: Reference

Selected color

Reference · #FFFFFF

rgb(255, 255, 255)hsl(0, 0%, 100%)

The specimen picks whichever of black or white has higher contrast. It demonstrates a pair, not a complete accessible component.

Illustrative scale: tints mix the reference with white, shades with black, by the stated percentage in encoded sRGB channels. This is not a perceptually uniform scale. Black tints and white shades remain useful; mixing black with black or white with white repeats the reference.

Text contrast on white

The table follows your selected swatch, currently #FFFFFF. Decisions use the full calculated ratio; displayed ratios are rounded.

Text against the selected white surface
Text colorRatioAA ordinary textAA large text
Black #00000021.00:1Pass · 4.5:1Pass · 3:1
White #FFFFFF1.00:1Fail · 4.5:1Fail · 3:1

Large text is at least 18pt, or 14pt bold. These numeric checks apply to opaque, solid color pairs. Other criteria, states, backgrounds, and exceptions need review. Read W3C’s contrast guidance.

White text depends entirely on the surface behind it. Recheck labels on bright brand colors, hover states, images, and disabled treatments separately.

Check a custom color pair ↗

IN A REAL INTERFACE

How to use white in product design

Give it one clear role

White can be a canvas, a raised surface, or foreground content on a dark component. These are separate roles even when they share the same value in a particular theme.

A UI example to try

A white settings panel on a pale canvas needs enough structure to distinguish controls from decoration. Use headings, spacing, and necessary boundaries rather than adding a shadow to every element.

Work through a real screen

Use white as the base of a form and inspect where controls, cards, and navigation begin and end. When neighboring surfaces are also white, spacing, borders, and elevation may carry the grouping. Decide which boundaries are essential rather than adding a shadow to every container.

Compare nearby colors by purpose

Compare white with beige or a light gray when choosing a page canvas. Keep a stable role for surfaces and verify text, placeholders, and state indicators on each one. White is not a universal safe background for every bright accent or pale label.

  1. Choose the role. Decide whether white is a surface, foreground, accent, or status. Name the semantic token after that purpose.
  2. Test the actual pair. Compare its foreground and background at the intended size. Test hover, selected, focus, and supported themes independently.
  3. Document the decision. Keep the approved code, usage rule, and contrasting companion together. Preserve labels and non-color cues when communicating a state.

Copy a white CSS palette

These numeric names are illustrative palette tokens, not a standard scale. Connect approved values to semantic tokens such as --surface-highlight or --text-primary after testing their pairs.

:root {
  --white-100: #FFFFFF;
  --white-300: #FFFFFF;
  --white-500: #FFFFFF;
  --white-700: #BFBFBF;
  --white-900: #808080;
}
Download CSS palette ↓

Turn palette values into semantic tokens ↗

Common questions about white

What is the HEX code for white?

The CSS named color white is #FFFFFF. Use that exact value when you want the standardized reference; use your own documented token when you mean a particular brand shade.

Is white accessible?

A color by itself cannot pass or fail accessibility. The foreground/background pair, content size, interaction state, and meaning all matter. Use the table above for the selected solid-color pair, then review the complete interface.

Explore related colors