Black Color
HEX #000000 · rgb(0, 0, 0) · hsl(0, 0%, 0%)
Black color codes
Black is one of the named colors every browser understands. In CSS you can write it as black or #000000.
| Format | Value | |
|---|---|---|
| HEX | #000000 | |
| RGB | rgb(0, 0, 0) | |
| HSL | hsl(0, 0%, 0%) | |
| CMYK | 0%, 0%, 0%, 100% | |
| CSS name | black |
.example {
color: black;
background-color: #000000;
border-color: rgb(0, 0, 0);
}
Tints and shades of black
Tints mix the color with white; shades mix it with black.
Contrast and readability
Black text
1.00:1
fails
1.00:1
fails
White text
21.00:1
passes AA and AAA
21.00:1
passes AA and AAA
Use white text on black. Ratios follow the WCAG 2 formula; AA needs 4.5:1 for normal text and 3:1 for large text.
Frequently asked questions
What is the hex code for black?
The hex code for black is #000000.
What is the RGB value of black?
Black is rgb(0, 0, 0): 0 red, 0 green and 0 blue on a 0 to 255 scale.
Does black have a complementary color?
No. Black has no hue, so it has no complement. It pairs with any color.
Should text on black be black or white?
Use white text. The contrast ratio is 1.00:1 with black and 21.00:1 with white. WCAG AA asks for at least 4.5:1 for normal text.
Similar named colors
#006400Dark Green
#191970Midnight Blue
#2F4F4FDark Slate Gray
#008000Green
#800000Maroon
#000080Navy
Pick any other color with the color picker, or browse all named colors.