BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
User Experience

FOUT: Why text flashes as web fonts load

FOUT (flash of unstyled text) is the moment a page shows text in a fallback font before its web font arrives. It's usually better than the alternative.

Monthly searches · fout
14.8k
Keyword research data
fout
FOUT: Why text flashes as web fonts load
Click the image to view it full size

FOUT, short for flash of unstyled text, happens when a page uses a web font that hasn't downloaded yet. The browser shows the text in a fallback font, such as Arial or the system font, and switches to the web font once it arrives. For a moment, readers see the text change shape.

The name comes from a 2009 post by developer Paul Irish, describing how Firefox and Opera rendered pages with custom fonts at the time. Paul Irish

FOUT vs. FOIT

A browser waiting for a web font has two options: show the text in another font now, or hide it until the right font is ready.

  • FOUT: the text appears right away in a fallback font, then swaps. Readers can start reading at once, but they may see a jump.
  • FOIT, flash of invisible text: the text stays invisible until the font loads, or until the browser gives up waiting. The layout is in place, but there's nothing to read.

On a slow connection, FOIT can mean several seconds of blank space where the headline and article should be. That's why FOUT is usually the lesser problem: a brief change of font beats text nobody can read.

How font-display controls it

You choose the behavior with the font-display descriptor in your @font-face rule. The browser runs a short timeline for each font: a block period, when text using the font is invisible, then a swap period, when fallback text is shown and swapped as soon as the font arrives. After that, it sticks with the fallback. MDN

Value Text hidden for Font swapped in Result
block 2–3 seconds any time FOIT, then a possible FOUT
swap 0 ms any time FOUT; text always visible
fallback 100 ms within 3 seconds, else never short FOUT at most
optional 100 ms no swap after that no FOUT; the web font may be skipped on that visit
auto varies by browser varies browser default

Timings as web.dev lists them. web.dev

@font-face {
  font-family: "Brand Sans";
  src: url("/fonts/brand-sans.woff2") format("woff2");
  font-display: swap;
}

Which value to pick depends on the font's job. For a logo or headline font where the look matters, swap keeps text visible and gets the brand font in. For body text, optional avoids any jump: if the font isn't ready almost at once, the reader simply keeps the fallback.

Why FOUT can hurt Core Web Vitals

The flash itself isn't the problem. The jump is. When the web font and the fallback take up different amounts of space, lines rewrap as the font swaps, and everything below moves. That movement counts toward Cumulative Layout Shift, one of the Core Web Vitals.

Delaying text has its own cost: while a headline waits for its font, it can also delay Largest Contentful Paint.

How to reduce FOUT

  1. Load fonts sooner. Put your @font-face rules in the page's <head> instead of a late stylesheet. For one or two critical fonts, preload them. Use preload sparingly: it competes with other important files.
  2. Make fonts smaller. Serve WOFF2 only, and drop characters you don't use. unicode-range lets the browser download a font file only when the page needs its characters. Check your font license before subsetting a font.
  3. Match the fallback to the web font. The size-adjust descriptor scales a fallback font so it takes up about the same space as your web font. Then the swap barely moves anything.
  4. Use fewer fonts. Every weight and style is another file. Two or three files load faster than eight.
  5. Use optional where the font isn't essential, so slow visits get no swap at all.

Test with a throttled connection in your browser's developer tools to see what readers on slow networks get. PageSpeed Insights shows the page's layout shift from real visits and from a lab test, so you can see whether a fix helped.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.