TypographyMay 2026 · 5 min read

CSS font-display: swap, optional, fallback Explained

Control how web fonts render during loading. Eliminate invisible text, reduce layout shift, and choose the right strategy for your site.

🔄
Try the Google Fonts Explorer
Free, no signup
DG
Derek Giordano
Designer & Developer
In this guide
01The Font Loading Problem02Each font-display Value Explained03Choosing the Right Strategy04Matching Fallback Font Metrics
⚡ Key Takeaways
  • Control how web fonts render during loading.
  • The Font Loading Problem.
  • Each font-display Value Explained.
  • Choosing the Right Strategy.
  • Matching Fallback Font Metrics.

The Font Loading Problem

When a browser encounters a web font, it faces a dilemma: show text immediately in a fallback (risking a visible swap) or hide text until the web font arrives (risking invisible content). The font-display property controls this behavior in your @font-face rule. Without it, browsers use their own defaults, which vary — Chrome hides text for up to 3 seconds, Safari hides it indefinitely. Explicit control ensures consistent behavior across browsers.

Each font-display Value Explained

Five values, each with different trade-offs. ‘auto’ — browser default, unpredictable. Avoid. ‘block’ — invisible for up to 3 seconds, then swaps. Only for icon fonts. ‘swap’ — fallback shows immediately, swaps when font loads. Most common. ‘fallback’ — invisible ~100ms, fallback ~3 seconds, then swaps. Good compromise. ‘optional’ — invisible ~100ms; if font doesn’t load in time, fallback used for entire visit. Best for performance — zero CLS, but font may not appear on first visit.

Choosing the Right Strategy

Choose based on priorities. Content-heavy sites where text must be readable immediately: ‘swap’ with well-matched fallback metrics. Performance-critical sites (e-commerce, landing pages): ‘optional’ — font loads in background and appears on subsequent cached visits with zero CLS. Apps where brand consistency matters: ‘fallback’ as compromise. Icon fonts: ‘block’ because showing a random letter instead of an icon is worse than a brief delay. Use the Google Fonts Explorer to find and preview fonts before choosing a loading strategy.

Matching Fallback Font Metrics

Layout shift from ‘swap’ happens because fallback fonts have different metrics (widths, heights) than your web font. CSS override descriptors can match them: ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; size-adjust: 107%;. This creates a custom fallback that matches your web font’s metrics so closely the swap is nearly invisible. Tools like Fontaine and Next.js font optimization generate these overrides automatically. Combined with ‘swap,’ matched metrics give both instant visibility and minimal shift.

Frequently Asked Questions

What’s the best font-display value?+
‘optional’ for maximum performance (zero CLS), ‘swap’ with matched fallback metrics for visibility plus minimal shift. It depends on whether you prioritize performance or brand consistency.
Does Google Fonts support font-display?+
Yes. Append &display=swap (or optional, fallback) to your Google Fonts URL: fonts.googleapis.com/css2?family=Inter&display=swap
Will ‘optional’ mean my font never loads?+
On first visit, if the font doesn’t load within ~100ms, the fallback is used. But the font downloads in background and caches. On subsequent visits, it loads from cache almost instantly, well within the 100ms window.
Try it yourself

Use the Google Fonts Explorer — free, no signup required.

⚡ Open Google Fonts Explorer
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.