Web Design & UI/UX8 min read

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.

By Boone
XLinkedIn
Best Text Color for UI: Why Text Is Not #000000, and the 6 Near-Blacks to Use

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

An article card on white with the title and body in pure black

#1F2328, GitHub's text color

The same article card with the title and body in a soft near-black
Same words, same size, same white. The right card is a few steps off black, and the paragraph reads calmer while still looking black.

#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

A pricing card with black text next to a blue Get Started button

#0A2540 next to #0570DE

The same pricing card with deep navy text that matches the blue button
The blue button is identical in both. On the left the black text and the blue look like two different products. On the right the navy and the blue look like one brand.

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

An issues list where titles, meta lines and the archived issue are all pure black

#1F2328, #59636E, #818B98

The same issues list with dark titles, gray meta lines and a lighter archived issue
On the left every line shouts at the same volume, so the archived issue looks as urgent as the open ones. On the right the eye reads titles first, details second, and skips what is archived.

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

A launch notes page with the title, paragraph and to-dos all in light gray

#37352F, Notion's text color

The same launch notes page in a warm near-black that reads easily
Softening is a small step off black, not a slide into gray. The left page looks elegant in a mockup and is hard work to read on a real screen.

#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

A dark issues list where every line is pure white

#F0F6FC, #9198A1, #656C76

The same dark issues list with off-white titles, gray meta lines and a dim archived issue
Pure white on a dark ground has the same problem pure black has on white, and one ink flattens the list the same way.

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

Six text colors real products ship. Tap a color to copy its code.
InkHexCharacterUse it when
Notion#37352FWarm, softest of the sixLong reading, docs, notes
Medium#242424NeutralArticles and blogs
GitHub#1F2328Neutral, slightly coolDense product UI
Material 3#1D1B20Neutral, a touch of violetAndroid and Material apps
Stripe#0A2540Deep navyA blue brand
Tailwind gray 900#111827Cool blue-grayTailwind 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

css
: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; } }
RoleLightDarkUse it for
Primary#1F2328#F0F6FCTitles, body, labels
Secondary#59636E#9198A1Timestamps, helper text, table headers
Disabled#818B98#656C76Disabled 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 groundContrast
#000000 on #FFFFFF21.00 to 1
#111827 on #FFFFFF17.74 to 1
#1D1B20 on #FFFFFF17.07 to 1
#1F2328 on #FFFFFF15.80 to 1
#0A2540 on #FFFFFF15.54 to 1
#242424 on #FFFFFF15.52 to 1
#37352F on #FFFFFF12.26 to 1
#59636E on #FFFFFF6.11 to 1
#818B98 on #FFFFFF3.45 to 1, disabled only
#A0A0A0 on #FFFFFF2.61 to 1, fails
#F0F6FC on #0D111717.39 to 1
#9198A1 on #0D11176.50 to 1
#656C76 on #0D11173.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 on bgColor-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.

More from Brainy Papers

Keep reading