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) 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
| CSS keyword | white |
|---|---|
| HEX | #FFFFFF |
| RGB | rgb(255, 255, 255) |
| HSL | hsl(0, 0%, 100%) |
| HWB | hwb(0 100% 0%) |
| OKLCH | oklch(100% 0 0) |
| CMYK (naive, no ICC profile) | cmyk(0%, 0%, 0%, 0%) |
| Decimal | 16,777,215 |
| Hue family | Whites 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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on white | 21.00:1 | Pass | Pass | Pass | Pass | 106.0 |
| White text on white | 1.00:1 | Fail | Fail | Fail | Fail | 0.0 |
| White text on white | 1.00:1 | Fail | Fail | Fail | Fail | 0.0 |
| White text on black | 21.00:1 | Pass | Pass | Pass | Pass | −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)
- 5%
#ffffff - 15%
#ffffff - 25%
#ffffff - 35%
#ffffff - 45%
#ffffff - 55%
#ffffff - 65%
#ffffff - 75%
#ffffff - 85%
#ffffff - 95%
#ffffff
Shades (mixed with black)
- 5%
#f2f2f2 - 15%
#d9d9d9 - 25%
#bfbfbf - 35%
#a6a6a6 - 45%
#8c8c8c - 55%
#737373 - 65%
#595959 - 75%
#404040 - 85%
#262626 - 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.
| Harmony | Rotation | Color |
|---|---|---|
| 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.
Code snippets
.element {
color: white;
background-color: #ffffff;
border-color: rgb(255 255 255);
outline-color: oklch(100% 0 0);
}<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 */import SwiftUI
extension Color {
static let white = Color(red: 1.000, green: 1.000, blue: 1.000)
}import androidx.compose.ui.graphics.Color
val White = Color(0xFFFFFFFF)import 'package:flutter/material.dart';
const white = Color(0xFFFFFFFF);<!-- 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.