Course contentsShow
← Web Development
Lesson 1271 of 2,98223. Web Font OptimizationFree lesson

Understanding Font Loading and FOIT/FOUT

Learn how browsers handle web font loading and the Flash of Invisible Text vs Flash of Unstyled Text problem.

Understanding Font Loading and FOIT/FOUT

You'll learn: How browsers display text while custom web fonts are loading and why you sometimes see invisible or unstyled text first.

The Font Loading Problem

When you specify a custom web font (like Google Fonts or a typeface file), the browser must download it before displaying text in that font. But what should the browser show while the font is downloading? This creates a dilemma with two common solutions that result in visible behavior patterns.

FOIT: Flash of Invisible Text

FOIT happens when the browser hides text completely until the custom font arrives. Users see blank spaces where text should be, then suddenly the text "flashes" into view once the font loads. This is like waiting for a train with the lights off—you can't see anything until it arrives.

Some browsers (especially older versions) use this strategy by default. The problem? If fonts load slowly or fail, users may see nothing for several seconds.

FOUT: Flash of Unstyled Text

FOUT occurs when the browser immediately displays text in a fallback system font (like Arial), then switches to the custom font once it loads. Users experience a visible "flash" as the text re-renders in the new typeface. This is like a store opening with temporary signage, then replacing it with the final branded sign later.

This approach prioritizes content visibility but can cause layout shifts if the fonts have different dimensions.

Why This Matters

Both behaviors impact user experience and perceived performance. An invisible page (FOIT) frustrates users who want to read content immediately. A shifting page (FOUT) can cause confusion or misclicks as text reflows.

Key Takeaway: FOIT hides text until fonts load (invisible flash), while FOUT shows fallback fonts first then switches (unstyled flash)—understanding both helps you control how users experience your typography during page load.