Black hex code

The hex code for black is #000000, or rgb(0, 0, 0). CSS also accepts the keyword black.

#000000
HEX#000000
RGBrgb(0, 0, 0)
HSLhsl(0, 0%, 0%)
HSV / HSBhsv(0, 0%, 0%)
OKLCHoklch(0% 0 0)
CMYKcmyk(0%, 0%, 0%, 100%)
Short HEX#000
HEX, 50% opacity#00000080
RGB, 50% opacityrgb(0 0 0 / 50%)
CSS nameblack
Defined inHTML 4.01 (one of the original 16 color names)

About black

black (#000000) has all three channels at zero. Its short form is #000.

Black text on white has the highest possible contrast ratio, 21:1. For a softer look, some designs use a dark gray for body text instead, such as darkslategray (#2F4F4F) or the lighter dimgray (#696969).

Tints of black

Black is darker than a usual 950 step, so it ends the scale and every other step is lighter and brighter. The steps follow a lightness curve modeled on Tailwind CSS's default palette; build your own in the Tailwind color generator. For black mixed with white, black or gray in even steps, use the tint and shade generator.

50#F7F7F7100#EFEFEF200#DEDEDE300#C8C8C8400#ACACAC500#9A9A9A600#7E7E7E700#676767800#555555900#464646950#000000

Colors that go with black

Black is a neutral color, so hue-based harmonies do not apply: it goes with any hue. Pair it with one accent color, or build a palette in the palette generator.

Text on black

White text on black: 21:1
TextRatioAA normalAA largeAAA normal
White21:1PassPassPass
Black1:1FailFailFail

The ratio is the same either way round, so black text on a white background is also 21:1. Check other pairs in the color contrast checker.

Similar named colors

The CSS named colors closest to black, by deltaE OK distance.

midnightblue #191970navy #000080darkblue #00008Bindigo #4B0082darkslategray #2F4F4Fmaroon #800000

See all 148 on the color names page.

Closest Tailwind CSS colors

black v4: black, #000000, exact match

black v3: black, #000000, exact match

Tailwind CSS has black as its own color, so bg-black and text-black give exactly #000000. A deltaE OK of around 0.02 is roughly the smallest difference most people notice side by side. Browse every shade on the Tailwind CSS colors page.

Black with color vision deficiency

Black has almost no hue, so it looks the same with any type of color vision deficiency. What matters is its lightness contrast with the colors next to it.

Test a whole palette or image in the color blindness simulator.

Using black in code

.example {
  color: black;                 /* named color */
  background-color: #000000;  /* hex */
  border-color: rgb(0, 0, 0);
}

Frequently asked questions

What is the hex code for black?
#000000, or #000 in short form. CSS also accepts the keyword black, which means the same color.
What is black in RGB?
rgb(0, 0, 0). In HSL it is hsl(0, 0%, 0%), and in OKLCH oklch(0% 0 0).
What text color goes on black?
White text has the higher contrast on #000000: 21:1, which meets AAA for all text. Black text reaches 1:1.
What is the closest Tailwind color to black?
Tailwind CSS has black as its own color, so bg-black and text-black give exactly #000000.
How do I make black transparent?
Add an alpha value. Half-transparent black is #00000080 as 8-digit HEX (80 is 128 out of 255) or rgb(0 0 0 / 50%).