3.4 Use WOFF2

About 30% smaller than WOFF, and universally supported.

Use WOFF2 font format

WOFF2 compresses roughly 30% better than WOFF, and every browser in current use supports it. There is no meaningful reason to ship anything else.

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

Older advice tells you to provide WOFF, TTF and EOT fallbacks. That advice is for browsers nobody uses. Each extra format is a file you maintain and a source line the browser parses; the fallback chain buys nothing.

Never serve .ttf or .otf to browsers — they are desktop formats: the same outlines without the web compression.

Subset

A font file covers every character in its character set. If your site is in English, you are shipping Cyrillic, Greek and Vietnamese glyphs nobody renders.

Subsetting to the ranges you need routinely halves a font. glyphhanger and subset-font do it at build time; Google Fonts does it automatically via unicode-range.

This is usually the single biggest saving available on fonts — bigger than the format choice.

Variable fonts

A variable font carries an axis — weight, width, optical size — in one file rather than one file per variant.

The trade is straightforward: one variable font is larger than one static weight, but smaller than three or four. If you use regular, medium and bold, the variable version is almost certainly a win. If you use exactly one weight, it is not.

Consider not loading one

The fastest font is the one already on the device. A system font stack costs zero bytes and zero requests, and renders instantly:

font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

A real option, not a cop-out. Plenty of well-designed products use it.

On this page