Pure black or off-black?
#000000 gives the maximum contrast a screen can show: 21:1 against white. That sounds ideal, but very few interfaces use it for large areas. Big pure-black backgrounds with pure-white text can look harsh, and some readers, especially people with astigmatism, report the letters seeming to glow or bleed. A black lifted by a few percent keeps almost all the contrast and feels softer.
| Black | HEX | White text | Typical use |
|---|---|---|---|
| Pure black | #000000 | 21.00:1 | Logos, icons, OLED “true black” themes |
| Material dark surface | #121212 | 18.73:1 | The dark-theme background Google's Material Design recommends |
| Tailwind gray-900 | #111827 | 17.74:1 | A blue-tinted near-black for dark UIs |
| Charcoal | #343837 | 11.89:1 | Clearly grey; for secondary panels, not main backgrounds |
Charcoal has its own page if you want something that is obviously grey rather than nearly black.
Black on OLED screens
On OLED phones, a #000000 pixel is switched off entirely, which saves a little battery and gives the “ink” look some people like. The catch is that pixels waking up from fully off can lag when you scroll, leaving a brief purple smear around moving content. A very dark grey such as #121212 keeps the pixels slightly on and avoids it.
Black text on white
For body copy, many sites use a dark grey rather than pure black. #333333 on white still scores 12.63:1, far above the 7:1 needed for AAA. The difference is subtle, but over a long article the page looks less stark.
Questions
What is the RGB code for black?
rgb(0, 0, 0), and in HSL any hue with 0% lightness, written hsl(0, 0%, 0%).
Is #000 the same as #000000?
Yes. Three-digit HEX doubles each digit, so #000 expands to #000000. The HEX to RGB page explains the shorthand.
What colour goes with black?
Almost anything, which is why black is a default. For strong accents, gold, red and white are the classic choices; for a quieter look, try charcoal and warm greys.