Basic HTML and CSS color
Black #000000
Black (CSS keyword black) has the hex code #000000 and the RGB value rgb(0, 0, 0): pure black.
Black (#000000) is one of the 16 original HTML colors. Pure black text on a pure white page has the maximum WCAG contrast ratio of 21:1, which some designers soften with a near-black for long reading.
Color codes for Black
| CSS keyword | black |
|---|---|
| HEX | #000000 |
| RGB | rgb(0, 0, 0) |
| HSL | hsl(0, 0%, 0%) |
| HWB | hwb(0 0% 100%) |
| OKLCH | oklch(0% 0 0) |
| CMYK (naive, no ICC profile) | cmyk(0%, 0%, 0%, 100%) |
| Decimal | 0 |
| Hue family | Grays and black |
Contrast and accessibility
On black, white text has a contrast ratio of 21.00:1 and passes AAA at any text size; black 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 black | 1.00:1 | Fail | Fail | Fail | Fail | 0.0 |
| White text on black | 21.00:1 | Pass | Pass | Pass | Pass | −107.9 |
| Black text on white | 21.00:1 | Pass | Pass | Pass | Pass | 106.0 |
| Black text on black | 1.00:1 | Fail | Fail | Fail | Fail | 0.0 |
Tints and shades
Each step mixes black with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, black, white 25%) in CSS.
Tints (mixed with white)
- 5%
#0d0d0d - 15%
#262626 - 25%
#404040 - 35%
#595959 - 45%
#737373 - 55%
#8c8c8c - 65%
#a6a6a6 - 75%
#bfbfbf - 85%
#d9d9d9 - 95%
#f2f2f2
Shades (mixed with black)
- 5%
#000000 - 15%
#000000 - 25%
#000000 - 35%
#000000 - 45%
#000000 - 55%
#000000 - 65%
#000000 - 75%
#000000 - 85%
#000000 - 95%
#000000
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, black's complementary color is #000000 (close to black), its analogous colors are #000000 and #000000, and its triadic partners are #000000 and #000000. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #000000 |
| Analogous | −30°, +30° | #000000#000000 |
| Triadic | +120°, +240° | #000000#000000 |
| Split-complementary | +150°, +210° | #000000#000000 |
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?
Black 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: black;
background-color: #000000;
border-color: rgb(0 0 0);
outline-color: oklch(0% 0 0);
}<div class="bg-[#000000] text-white">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-black: #000000;
}
/* then use bg-black, text-black, border-black */import SwiftUI
extension Color {
static let black = Color(red: 0.000, green: 0.000, blue: 0.000)
}import androidx.compose.ui.graphics.Color
val Black = Color(0xFF000000)import 'package:flutter/material.dart';
const black = Color(0xFF000000);<!-- res/values/colors.xml -->
<color name="black">#000000</color>Frequently asked questions
- What is the hex code for black?
- The hex code for black is #000000. The same color is rgb(0, 0, 0), hsl(0, 0%, 0%) and oklch(0% 0 0), and in CSS you can also write the keyword black directly.
- Is black a warm or cool color?
- Black 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 black?
- Rotating the hue in OKLCH while keeping lightness and chroma, black's complementary color is #000000 (close to black), its analogous colors are #000000 and #000000, and its triadic partners are #000000 and #000000. For text on top, white gives the higher contrast.
- Can you use white text on black?
- White text on black has a contrast ratio of 21.00:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.00:1 and fails AA even for large text. In APCA terms that is Lc −107.9 for white and Lc 0.0 for black.
- What is the RGB value of black?
- Black is rgb(0, 0, 0): red 0, green 0 and blue 0 on the 0 to 255 scale, or 0.0%, 0.0% and 0.0%. As a decimal integer it is 0.
Last reviewed by Arielton Oberek.