Best Text Color for UI: Why Text Is Not #000000, and the 6 Near-Blacks to Use
Pure black is the default text color in every tool, and it is rarely the best one. Soften it to a near-black like #1F2328, tint it toward your brand, use three inks, and stop before it turns gray.

The best text color for a UI on white is a near-black, not #000000. Pure black is what every tool hands you, and on a bright page of long text it is the harshest choice you can make. Here are the four fixes, the six near-blacks real products ship, and the tokens to hand your developer.
Why #000000 is the default
Nobody picks #000000 after comparing it. A page with no CSS shows its text in black, and a new text layer in Figma starts as #000000. It is the default, so it ships.
Black on white is the strongest contrast a screen can show. That sounds like a win, and for a single label it is fine. Across a whole article it looks hard and cold, and it sits apart from every other color on the page, because nothing else in a modern palette is that extreme.
It is a rule of thumb, not a ban. Apple's own label color on iOS is pure black. The fix matters most where people read a lot of text on a white ground: articles, docs, settings and dashboards.
Fix 1: soften the black
#000000

#1F2328, GitHub's text color

#1F2328 is the default text color in GitHub's Primer system. It is close enough to black that it never looks gray, and far enough that a long paragraph stops looking like it was stamped on.
The same move works for every block of reading text: article bodies, help docs, long settings descriptions, email bodies and chat messages. Short UI labels can keep the same ink, so the page stays one family.
Fix 2: tint it toward your brand
#000000 next to #0570DE

#0A2540 next to #0570DE

Stripe sets its text in #0A2540, a deep navy, and its Elements docs use #0570DE as the example primary. A neutral black has no hue, so it fights every brand color it sits next to. A near-black with a little of your brand's hue in it joins the palette instead.
Take your primary color, keep its hue, and drop the lightness until it reads as almost black. The same tinted ink works for headings, prices, table text and the labels inside forms, anywhere text sits close to the brand color.
Fix 3: three inks, not one
One ink, #000000

#1F2328, #59636E, #818B98

One ink cannot show what matters. GitHub's three levels do it with color alone: #1F2328 for what you read first, #59636E for details such as the issue number and age, and #818B98 for things that are switched off.
Use the same three roles everywhere: titles and body, then timestamps, helper text and table headers, then disabled buttons and archived rows. Our gray text color paper covers how light the middle level can go on each background.
Fix 4: do not go too far
#A0A0A0

#37352F, Notion's text color

#A0A0A0 is where "soft" turns into "faint". It fails the WCAG minimum for text on white, and a whole page of it reads like it is disabled.
Notion's #37352F is the softest of the six inks below, and it is still clearly black on a white page. Use it as a lower bound for main text. Anything lighter belongs only to the secondary and disabled levels.
In dark mode, the same rule runs in reverse
#FFFFFF on #0D1117

#F0F6FC, #9198A1, #656C76

GitHub's dark theme uses #F0F6FC for main text, #9198A1 for secondary and #656C76 for disabled, on a #0D1117 ground. That is the same three-level system with every value picked against the dark surface. For the surfaces themselves, see dark mode color systems.
The six near-blacks to steal
| Ink | Hex | Character | Use it when |
|---|---|---|---|
| Notion | #37352F | Warm, softest of the six | Long reading, docs, notes |
| Medium | #242424 | Neutral | Articles and blogs |
| GitHub | #1F2328 | Neutral, slightly cool | Dense product UI |
| Material 3 | #1D1B20 | Neutral, a touch of violet | Android and Material apps |
| Stripe | #0A2540 | Deep navy | A blue brand |
| Tailwind gray 900 | #111827 | Cool blue-gray | Tailwind projects |
All six pass the WCAG minimum on white by a wide margin, so the choice is about character, not readability. Pick the one closest to your brand's temperature.
Hand this to your developer
:root {
--text-primary: #1F2328; /* titles and body */
--text-secondary: #59636E; /* meta, helper text */
--text-disabled: #818B98; /* disabled only */
}
@media (prefers-color-scheme: dark) {
:root {
--text-primary: #F0F6FC;
--text-secondary: #9198A1;
--text-disabled: #656C76;
}
}
| Role | Light | Dark | Use it for |
|---|---|---|---|
| Primary | #1F2328 | #F0F6FC | Titles, body, labels |
| Secondary | #59636E | #9198A1 | Timestamps, helper text, table headers |
| Disabled | #818B98 | #656C76 | Disabled controls, archived rows |
In GitHub's Primer these are fgColor-default, fgColor-muted and fgColor-disabled. Name your tokens by role the same way, so swapping in a brand-tinted ink later is one line.
The numbers behind "easy to read"
| Text on ground | Contrast |
|---|---|
| #000000 on #FFFFFF | 21.00 to 1 |
| #111827 on #FFFFFF | 17.74 to 1 |
| #1D1B20 on #FFFFFF | 17.07 to 1 |
| #1F2328 on #FFFFFF | 15.80 to 1 |
| #0A2540 on #FFFFFF | 15.54 to 1 |
| #242424 on #FFFFFF | 15.52 to 1 |
| #37352F on #FFFFFF | 12.26 to 1 |
| #59636E on #FFFFFF | 6.11 to 1 |
| #818B98 on #FFFFFF | 3.45 to 1, disabled only |
| #A0A0A0 on #FFFFFF | 2.61 to 1, fails |
| #F0F6FC on #0D1117 | 17.39 to 1 |
| #9198A1 on #0D1117 | 6.50 to 1 |
| #656C76 on #0D1117 | 3.57 to 1, disabled only |
Every near-black here clears the WCAG minimum for body text several times over. That is why this page says "easy to read" instead of leading with a number: the softer inks lose nothing that matters. #818B98 and #656C76 fall under the bar, which is fine only because WCAG exempts disabled controls.
FAQ
What is the best text color for UI design?
A near-black, not #000000. #1F2328 (GitHub) and #37352F (Notion) are safe choices on white.
Is pure black text bad?
Not wrong, just harsh for long reading on a white page. iOS uses pure black for its label color, so treat this as a rule of thumb for text-heavy screens.
What hex code should body text be?
#1F2328, #242424 or #111827 for a neutral feel, #37352F for a warm one, or a navy like #0A2540 next to a blue brand.
What color should secondary text be?
A mid gray that still reads, such as #59636E on white. Keep the lighter #818B98 for disabled text only.
What text color should I use in dark mode?
An off-white such as #F0F6FC rather than #FFFFFF, with #9198A1 for secondary text on a dark ground like #0D1117.
Sources
- GitHub Primer, @primer/primitives 11.10.0: light
fgColor-default#1F2328,fgColor-muted#59636E,fgColor-disabled#818B98; dark #F0F6FC, #9198A1, #656C76 onbgColor-default#0D1117. See also primer.style. - Stripe, Elements Appearance API: #0570DE is the primary in the example theme. Stripe's #0A2540, Notion's #37352F and Medium's #242424 come from their public CSS.
- Material 3 color roles: #1D1B20 is the baseline on-surface color.
- Tailwind CSS v3 colors: gray 900 is #111827.
- Apple, UIColor.label: the iOS label color, pure black in light mode.
- WCAG 2, 1.4.3 Contrast (Minimum): 4.5 to 1 for body text, with disabled controls exempt.
- Ratios computed with the WCAG relative luminance formula.
- The article, pricing card, issues and launch notes are invented for this page.
- First published as a carousel on UX Brainy.




