To make web fonts load faster, convert them from TTF or OTF to WOFF2 and subset them, removing every character your site doesn’t use. WOFF2 alone typically makes a font noticeably smaller than its TTF original, and subsetting a text font to Latin characters often takes it from 100–300 KB down to 15–30 KB. Every browser in use today supports WOFF2, so it’s the only format most sites need.
This guide explains the formats, how subsetting works, the @font-face CSS to load the result, and the licensing check to do first.
Key takeaways
- TTF and OTF are desktop formats. WOFF2 is the same font compressed for the web.
- In Google’s tests on the Google Fonts collection, WOFF2 files averaged 29% smaller than WOFF.
- Subsetting removes unused characters, which usually saves far more than the format change.
- Use
unicode-rangeto split a font into language subsets that load only when needed. - Check the font’s licence before converting or subsetting a commercial font.
TTF, OTF, WOFF and WOFF2
| Format | What it is | Use on the web? |
|---|---|---|
| TTF / OTF | Desktop font files for design apps and operating systems | Only as a last resort |
| WOFF | A web wrapper with older zlib compression | No longer needed |
| WOFF2 | The web format, with Brotli compression and font-specific tricks | Yes: the default |
WOFF2 grew out of Google’s font compression work and is a W3C standard. It packs the same outlines and features as the original font, so it looks identical, but uses Brotli compression plus pre-processing that suits font data. Unless you need to support very old browsers, you can drop WOFF and TTF from your @font-face rules entirely.
What subsetting removes
Most fonts carry far more than an English-language site will ever show: Greek, Cyrillic and Vietnamese characters, maths symbols, rare punctuation, and alternate letter shapes. Subsetting keeps only the characters you choose.
- Basic Latin covers English and the characters on a standard keyboard.
- Latin-1 Supplement and Latin Extended add accented letters for French, German, Spanish, Polish and other European languages.
- Extra symbols such as £, €, curly quotes, dashes and arrows are worth adding explicitly if your content uses them.
Smaller fonts appear sooner, which shortens the time text spends invisible or in a fallback font and reduces the layout shift when the web font swaps in.
Loading the converted font with @font-face
@font-face {
font-family: "Inter";
src: url("/fonts/inter-latin.woff2") format("woff2");
font-weight: 100 900; /* a weight range for variable fonts */
font-style: normal;
font-display: swap;
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC;
}
body {
font-family: "Inter", system-ui, sans-serif;
}
font-display: swapshows a fallback font straight away and swaps in the web font when it arrives, so text is never invisible.- For a variable font, give
font-weighta range (here100 900) so one file serves every weight. - Preload the one or two fonts used above the fold:
<link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin>. Thecrossoriginattribute is needed even for fonts on your own domain.
Splitting fonts with unicode-range
unicode-range tells the browser which characters a font file covers. Give several @font-face rules the same family name, each with its own file and range, and the browser downloads only the files whose characters appear on the page. That’s how large font services serve Latin readers one small file and Cyrillic readers another.
@font-face {
font-family: "Inter";
src: url("/fonts/inter-latin.woff2") format("woff2");
unicode-range: U+0000-00FF;
}
@font-face {
font-family: "Inter";
src: url("/fonts/inter-cyrillic.woff2") format("woff2");
unicode-range: U+0400-04FF;
}
Why self-host your fonts?
Converting and subsetting is most useful when you host fonts yourself rather than loading them from a font service. Self-hosting removes a connection to another domain, lets you control exactly which characters and weights ship, and keeps visitors’ IP addresses off third-party servers. That last point matters in Europe: in 2022 a Munich court found that loading Google Fonts from Google’s servers without consent breached GDPR.
Licences: check before you convert
Converting and subsetting change the font file, which some licences don’t allow. Open-source fonts under the SIL Open Font License, such as most Google Fonts, can be converted and subset freely. Many commercial licences only permit web use of files supplied by the foundry, or forbid modification. Read the licence, or ask the foundry, before converting a font you’ve bought.
Tip: Hinting helps fonts render crisply at small sizes on older, low-resolution Windows screens. Most screens today are high-resolution, so removing hinting is usually safe and saves a lot of space. Keep it if many of your visitors use older Windows PCs.
Will subsetting break kerning or ligatures?
Not if it’s done properly. A good subsetter such as HarfBuzz keeps the layout features (kerning, ligatures, alternates) for every character you keep, along with any extra glyphs those features need. The catch is content you didn’t plan for: if editors later paste text with characters outside your subset, those characters fall back to another font. Type your own sample text into a preview before you ship, and include a little more than you think you need.
Convert and subset your fonts
The font converter and subsetter converts TTF, OTF and WOFF files to WOFF2 using HarfBuzz and Google’s WOFF2 encoder, compiled to run in your browser, so your fonts are never uploaded. Tick the character sets you need, add any extra symbols, keep or fix variable axes, preview your own text, then download the fonts with matching @font-face CSS. To explore a variable font’s axes before you subset it, try the variable font playground, and see the fluid typography guide for sizing the result.
Sources: W3C: WOFF File Format 2.0, LWN: WOFF2 compression results.

