# Black Color Code: #000000 Hex, RGB & Palettes

The CSS black reference is #000000, rgb(0, 0, 0), or hsl(0, 0%, 0%). Brand shades may differ. HEX and RGB encode the same sRGB reference; HSL is rounded to two decimals. These are screen values, not a CMYK print specification.

## Tints and shades

Illustrative mixes with white or black in encoded sRGB channels, not a perceptually uniform scale.

| Shade | HEX | RGB | HSL | Black text contrast | White text contrast |
| --- | --- | --- | --- | --- | --- |
| Tint 80% | #CCCCCC | rgb(204, 204, 204) | hsl(0, 0%, 80%) | 13.08:1 | 1.61:1 |
| Tint 40% | #666666 | rgb(102, 102, 102) | hsl(0, 0%, 40%) | 3.66:1 | 5.74:1 |
| Reference | #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) | 1.00:1 | 21.00:1 |
| Shade 25% | #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) | 1.00:1 | 21.00:1 |
| Shade 50% | #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) | 1.00:1 | 21.00:1 |

## Text contrast

AA ordinary text requires at least 4.5:1; large text requires at least 3:1. Large text is at least 18pt, or 14pt bold. Use unrounded ratios for decisions. Color pairs alone cannot certify accessibility; review criteria, states, context, and exceptions.

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.

## How to use black in product design

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.

1. Choose a foreground, surface, accent, or status role and name a semantic token after its purpose.
2. Test the actual pair, text size, interaction states, and themes.
3. Document the approved value and companion colors. Keep labels and non-color cues for states.

## CSS palette

Illustrative numeric tokens; connect tested pairs to semantic roles.

```css
:root {
  --black-100: #CCCCCC;
  --black-300: #666666;
  --black-500: #000000;
  --black-700: #000000;
  --black-900: #000000;
}
```

## What is the HEX code for black?

The CSS named color black is #000000. Use a documented brand token when you mean another shade.

## Is black accessible?

A color alone cannot pass or fail accessibility. Evaluate the pair, content size, interaction state, and meaning in the complete interface.

## Related colors

- [gray color codes](https://designproject.io/resources/colors/gray/)

- [white color codes](https://designproject.io/resources/colors/white/)

- [navy color codes](https://designproject.io/resources/colors/navy/)

## Sources and next steps

By The Design Project. UI examples and generated scales are illustrative.

- [MDN CSS named colors](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/named-color)
- [W3C contrast guidance](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html)
- [UI color palette guide](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Semantic color tokens](https://designproject.io/resources/guides/create-semantic-color-tokens/)
- [Color contrast checker](https://designproject.io/resources/guides/check-color-contrast/)
- [Design glossary](https://designproject.io/resources/glossary/)

Canonical: https://designproject.io/resources/colors/black/

## Keep learning

- [How to create a UI color palette, step by step](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Product design glossary: 44 terms explained](https://designproject.io/resources/glossary/)
- [How to create semantic color tokens for UI](https://designproject.io/resources/guides/create-semantic-color-tokens/)
