Skip to content

Basic HTML and CSS color

White #FFFFFF

White (CSS keyword white) has the hex code #FFFFFF and the RGB value rgb(255, 255, 255): pure white.

White#FFFFFF

White (#ffffff) is one of the 16 original HTML colors and the default canvas color in browsers. Every other named color's contrast ratio against white is shown on its page.

Color codes for White

Color codes for White
CSS keywordwhite
HEX#FFFFFF
RGBrgb(255, 255, 255)
HSLhsl(0, 0%, 100%)
HWBhwb(0 100% 0%)
OKLCHoklch(100% 0 0)
CMYK (naive, no ICC profile)cmyk(0%, 0%, 0%, 0%)
Decimal16,777,215
Hue familyWhites and off-whites

Contrast and accessibility

On white, black text has a contrast ratio of 21.00:1 and passes AAA at any text size; white text reaches 1.00:1.

WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on white21.00:1PassPassPassPass106.0
White text on white1.00:1FailFailFailFail0.0
White text on white1.00:1FailFailFailFail0.0
White text on black21.00:1PassPassPassPass−107.9

Tints and shades

Each step mixes white with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, white, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #ffffff
  2. 15%
    #ffffff
  3. 25%
    #ffffff
  4. 35%
    #ffffff
  5. 45%
    #ffffff
  6. 55%
    #ffffff
  7. 65%
    #ffffff
  8. 75%
    #ffffff
  9. 85%
    #ffffff
  10. 95%
    #ffffff

Shades (mixed with black)

  1. 5%
    #f2f2f2
  2. 15%
    #d9d9d9
  3. 25%
    #bfbfbf
  4. 35%
    #a6a6a6
  5. 45%
    #8c8c8c
  6. 55%
    #737373
  7. 65%
    #595959
  8. 75%
    #404040
  9. 85%
    #262626
  10. 95%
    #0d0d0d

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, white's complementary color is #FFFFFF (close to white), its analogous colors are #FFFFFF and #FFFFFF, and its triadic partners are #FFFFFF and #FFFFFF. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#ffffff
Analogous−30°, +30°#ffffff#ffffff
Triadic+120°, +240°#ffffff#ffffff
Split-complementary+150°, +210°#ffffff#ffffff

Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.

Warm or cool?

White is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.

Nearest named and Tailwind colors

Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.

Nearest CSS named colors

Nearest CSS named colors
ColorHEXΔE OK
snow#fffafa1.2
mintcream#f5fffa1.5
azure#f0ffff1.9

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
olive-50#fbfbf91.2
mist-50#f9fbfb1.3
taupe-50#fbfaf91.4

Code snippets

CSS
.element {
  color: white;
  background-color: #ffffff;
  border-color: rgb(255 255 255);
  outline-color: oklch(100% 0 0);
}
Tailwind CSS
<div class="bg-[#ffffff] text-black">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-white: #ffffff;
}
/* then use bg-white, text-white, border-white */
SwiftUI
import SwiftUI

extension Color {
  static let white = Color(red: 1.000, green: 1.000, blue: 1.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val White = Color(0xFFFFFFFF)
Flutter
import 'package:flutter/material.dart';

const white = Color(0xFFFFFFFF);
Android XML
<!-- res/values/colors.xml -->
<color name="white">#FFFFFF</color>

Frequently asked questions

What is the hex code for white?
The hex code for white is #FFFFFF. The same color is rgb(255, 255, 255), hsl(0, 0%, 100%) and oklch(100% 0 0), and in CSS you can also write the keyword white directly.
Is white a warm or cool color?
White is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.
What colors go with white?
Rotating the hue in OKLCH while keeping lightness and chroma, white's complementary color is #FFFFFF (close to white), its analogous colors are #FFFFFF and #FFFFFF, and its triadic partners are #FFFFFF and #FFFFFF. For text on top, black gives the higher contrast.
Can you use white text on white?
White text on white has a contrast ratio of 1.00:1, which fails AA even for large text under WCAG 2.2. Black text reaches 21.00:1 and passes both AA and AAA. In APCA terms that is Lc 0.0 for white and Lc 106.0 for black.
What is the RGB value of white?
White is rgb(255, 255, 255): red 255, green 255 and blue 255 on the 0 to 255 scale, or 100.0%, 100.0% and 100.0%. As a decimal integer it is 16777215.

Last reviewed by Arielton Oberek.