Free Accessible CSS Gradient Generator

← All Colors
#000000 Black

Black Hex Code #000000

Black is pure black, the darkest color a screen can show, with the hex code #000000. In RGB it is 0, 0, 0, and in HSL it is 0°, 0%, 0%. It is one of the 148 named colors in CSS, so you can write “black” instead of the hex code.

HEX
#000000
RGB
rgb(0, 0, 0)
HSL
hsl(0, 0%, 0%)
HSV
hsv(0°, 0%, 0%)
CMYK
cmyk(0%, 0%, 0%, 100%)
CSS name
black

CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.

About Black

On a white background Black has a contrast ratio of 21.00:1 (AAA), and on black 1.00:1 (Fail). White text is the better choice on top of it.

It has almost no hue of its own, so it pairs comfortably with almost any accent color.

Grays do much of the quiet work in interface design: text, borders, backgrounds and disabled states. Because they carry no strong hue, they pair with almost any accent color.

Good to know: Black (#000000) has a relative luminance of 0 and gives the highest possible contrast against white, 21:1. Pure black text on pure white can feel harsh over long reading, so many designers use a very dark gray instead.

Shades and tints of Black

Tints mix Black with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.

Pairing Black with an accent color

Black has almost no hue of its own, so color schemes built from it would all look the same. A neutral works best as a background or text color beside an accent. This is how six accent colors contrast with Black.

Black contrast and accessibility

WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Black scores against white and black.

Contrast of Black with white and black
AgainstRatioAA normalAA largeAAA normalAAA large
White (#ffffff) 21.00:1 ✓ Pass ✓ Pass ✓ Pass ✓ Pass
Black (#000000) 1.00:1 ✕ Fail ✕ Fail ✕ Fail ✕ Fail
Aa White text on Black21.00:1
Aa Black text on Black1.00:1

Black and color blindness

These are approximate previews of how Black can look with the main types of color vision deficiency.

Protanopia #000000

Black looks almost the same.

Deuteranopia #000000

Black looks almost the same.

Tritanopia #000000

Black looks almost the same.

Achromatopsia #000000

Black looks almost the same.

Gradients with Black

Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.

Black to a lighter tint

background: linear-gradient(135deg, #000000 0%, #999999 100%);

Black to Gold

background: linear-gradient(135deg, #000000 0%, #ffd700 100%);

Black to Dark Orange

background: linear-gradient(135deg, #000000 0%, #ff8c00 100%);

Colors similar to Black

How each close match differs from Black.

More gray & black colors →

Use Black in code

CSS
.element {
  color: #000000;
  background-color: #000000;
  border-color: black;   /* black is a valid CSS color name */
}
CSS variable
:root {
  --color-black: #000000;
}
Tailwind
<!-- Tailwind arbitrary values -->
<div class="bg-[#000000] text-[#000000] border-[#000000]"></div>

/* Tailwind v4 theme color */
@theme {
  --color-black: #000000;
}

Black questions

What is the hex code for Black?

The hex code for Black is #000000. In RGB that is rgb(0, 0, 0), and in HSL it is hsl(0, 0%, 0%).

Which colors go well with Black?

Black is a neutral color with almost no hue of its own, so it has no true complement and pairs with nearly any accent. The accents that contrast most strongly against it are Gold (14.97:1), Dark Orange (9.00:1), Sea Green (4.95:1).

Should I use white or black text on Black?

White text. It has a contrast ratio of 21.00:1 against Black, which is WCAG AAA. The other option scores 1.00:1.

Is Black accessible as a text color on white?

Yes. Black on white scores 21.00:1, which passes WCAG AA for normal text (4.5:1) and AAA (7:1).

What are darker and lighter shades of Black?

Mixing Black with black gives #000000, #000000, #000000, #000000 (20% to 80% black). Mixing it with white gives #333333, #666666, #999999, #CCCCCC (20% to 80% white).

More color tools