THE COLOR LIBRARY / Neutral
Black color codes.
The CSS black color code is #000000. Its RGB value is rgb(0, 0, 0) and its HSL value is hsl(0, 0%, 0%). Start with the exact reference, then choose a shade for the job.
A color name describes a family in everyday language. This page uses the standardized CSS keyword as its reference; your brand’s black may be different.
Explore the shades ↓COPY. PASTE. MAKE IT YOURS.
Black in HEX, RGB, and HSL
#000000rgb(0, 0, 0)hsl(0, 0%, 0%)HEX and RGB encode the same sRGB reference. HSL is calculated from it and rounded to two decimals for display. These are screen color values, not a CMYK print specification.
ONE COLOR. DIFFERENT ROLES.
Explore black tints and shades
Select a swatch to see its codes and compare text contrast.
Make the next step clear.
A label, a surface, and room to breathe.
Selected: ReferenceSelected color
Reference · #000000
rgb(0, 0, 0)hsl(0, 0%, 0%)The specimen picks whichever of black or white has higher contrast. It demonstrates a pair, not a complete accessible component.
Illustrative scale: tints mix the reference with white, shades with black, by the stated percentage in encoded sRGB channels. This is not a perceptually uniform scale. Black tints and white shades remain useful; mixing black with black or white with white repeats the reference.
Text contrast on black
The table follows your selected swatch, currently #000000. Decisions use the full calculated ratio; displayed ratios are rounded.
| Text color | Ratio | AA ordinary text | AA large text |
|---|---|---|---|
| Black #000000 | 1.00:1 | Fail · 4.5:1 | Fail · 3:1 |
| White #FFFFFF | 21.00:1 | Pass · 4.5:1 | Pass · 3:1 |
Large text is at least 18pt, or 14pt bold. These numeric checks apply to opaque, solid color pairs. Other criteria, states, backgrounds, and exceptions need review. Read W3C’s contrast guidance.
Pure black and white produce the maximum WCAG contrast ratio of 21:1. That single pair does not establish the accessibility of the rest of the interface.
Check a custom color pair ↗IN A REAL INTERFACE
How to use black in product design
Give it one clear role
Black offers a strong foreground or a dark canvas. Use hierarchy, spacing, and surface levels to keep dense content readable instead of relying on every element having maximum visual emphasis.
A UI example to try
A black reading surface can use white primary text and independently tested secondary text. Selected items and focus outlines still need to stand out from nearby dark surfaces.
Work through a real screen
Test black as a primary foreground or dark surface with the exact accompanying colors. A pure black background can make bright accents feel especially strong, so inspect focus indicators, borders, and long-form text together. Different dark surfaces may be useful for hierarchy, but each needs a defined role.
Compare nearby colors by purpose
Compare black with navy or dark gray when the product needs a softer or more chromatic dark treatment. Do not assume that reducing contrast everywhere improves comfort; preserve readable content and recognizable controls while evaluating the composition.
- Choose the role. Decide whether black is a surface, foreground, accent, or status. Name the semantic token after that purpose.
- Test the actual pair. Compare its foreground and background at the intended size. Test hover, selected, focus, and supported themes independently.
- Document the decision. Keep the approved code, usage rule, and contrasting companion together. Preserve labels and non-color cues when communicating a state.
Copy a black CSS palette
These numeric names are illustrative palette tokens, not a standard scale. Connect approved values to semantic tokens such as --surface-highlight or --text-primary after testing their pairs.
:root {
--black-100: #CCCCCC;
--black-300: #666666;
--black-500: #000000;
--black-700: #000000;
--black-900: #000000;
}Common questions about black
What is the HEX code for black?
The CSS named color black is #000000. Use that exact value when you want the standardized reference; use your own documented token when you mean a particular brand shade.
Is black accessible?
A color by itself cannot pass or fail accessibility. The foreground/background pair, content size, interaction state, and meaning all matter. Use the table above for the selected solid-color pair, then review the complete interface.