Skip to content
IndexRequest a UIAboutContact

Font Family Fallback Stacks

Four common font stacks and a missing-font switch that shows the browser falling back to the next choice.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI IMAGE OR VIDEO TOOL
Typography specimen sheet showing the same sentence in four font stacks in a clean list, a serif stack in Georgia style, a neutral sans stack in system style, a monospace stack and a rounded sans stack, each with the CSS font-family line in small grey monospace underneath and the characters Il1 O0 rn m highlighted to compare ambiguity, off-white background, near-black text, generous spacing. Negative: decorative display fonts, colour, shadows, text errors. Reduced motion: static sheet.

About this pattern

Definition

A font stack is a prioritised list: the browser uses the first font that is installed and falls back to the next if not, ending in a generic family such as serif, sans-serif or monospace that always exists. Good stacks keep the page looking right even when the preferred font fails to load.

When to use it

  • Put the preferred font first, close alternatives next, and a generic family last.
  • system-ui and ui-monospace use the operating system's own fonts and load instantly.
  • Choose fallbacks with similar width and x-height so the layout does not jump.
  • Always end with a generic family.

What the controls do

  • Four stack buttons and a Pretend first font is missing checkbox.

Motion & timing

  • The text changes instantly.
  • Reduced motion: nothing animates.

Tips & variations

  • Test with the preferred font blocked to see what people on slow connections see.
  • Use font-display: swap for web fonts and size-adjust to reduce the jump.

Code of this live preview

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Stack"><button data-p="0" aria-pressed="true">Serif</button><button data-p="1" aria-pressed="false">Sans</button><button data-p="2" aria-pressed="false">Mono</button><button data-p="3" aria-pressed="false">Rounded</button></div><div class="sp" id="sp"><h4>The quick brown fox</h4><p>Il1 O0 rn m: tell similar shapes apart.</p></div><pre class="cs" id="cs"></pre><label class="sw"><input id="ms" type="checkbox"> Pretend the first font is missing</label><p class="out" id="out"></p></div>

Related patterns

Type Voices

↗
Type VoicesType Styles

Font Pairing & Hierarchy

↗
Font Pairing & HierarchyType Styles

Modular Type Scale

↗
Modular Type ScaleType Styles