Converting TTF to WOFF2 is the usual last step before putting a font on a website. WOFF2 holds the same font in roughly a third of the size, which means faster pages and less layout shift while text loads. Drop your TTF or OTF files here, keep WOFF2 selected, and download; the tool also writes the @font-face rules for you.
A real example
Here are two open-source fonts, one with TrueType outlines and one with PostScript (CFF) outlines, converted together:
| Font | TTF/OTF | WOFF2 | Saved |
|---|---|---|---|
| Lato Bold | 57.8 KB | 22.5 KB | 61% |
| Source Sans 3 Regular | 327.1 KB | 150.8 KB | 54% |
The Lato result is byte-for-byte the same size as the WOFF2 that the font’s own distribution ships, because the same compression engine is used. Unpacking both WOFF2 files again gave back tables identical to the originals.
The CSS you get
After converting, open CSS for these fonts under the list. For Lato Bold it looks like this:
@font-face {
font-family: "Lato";
src: url("lato-bold.woff2") format("woff2");
font-weight: 700;
font-style: normal;
font-display: swap;
}
The family name, weight and style are read from the font itself. Put the .woff2 file next to your stylesheet (or change the path), and use font-family: "Lato", sans-serif; in your CSS. Add one @font-face block per weight and style you use; converting several files at once gives you all the blocks.
One thing to check first
Converting does not change a font’s licence. Look at the licence and embedding line under each font before you upload: fonts under the SIL Open Font License, like the two above, may be used on any website. Some commercial fonts allow desktop use only, and a few are marked “restricted” by their makers.
WOFF2 only, in 2026
Older guides tell you to ship WOFF alongside WOFF2, and sometimes TTF and EOT as well. That advice is obsolete. WOFF2 has been supported by every current browser since 2016 — Chrome, Edge, Firefox, Safari, and mobile — so a single format covers essentially all real traffic.
Serving extra formats costs you nothing in bytes (browsers pick one) but it does add clutter, and the fallback stack is the kind of thing that quietly breaks. One src line with one format is correct now.
The compression is Brotli, which is why the saving is so large: 54% and 61% in the table above, and the Lato result is byte-identical to the WOFF2 the font’s own project ships.
Subset before you convert, if you can
Conversion is lossless — every glyph in the TTF ends up in the WOFF2. That is often far more than a website needs.
A full Latin-plus-Cyrillic-plus-Greek font carries thousands of glyphs. An English-language site uses perhaps 100. Subsetting to the characters you actually serve typically cuts the file by another 60–80%, well beyond what format conversion alone achieves.
So the order that gives the smallest result is: subset first (with pyftsubset or a font tool), then convert to WOFF2. If you cannot subset, converting still gives you the 50–60% above.
Also drop weights you do not use. Four weights × two styles is eight files; most sites genuinely need two or three.
font-display: swap, and why it is in the generated CSS
The generated @font-face includes font-display: swap. That tells the browser to show text immediately in a fallback font and swap in the web font when it arrives, rather than leaving a blank space.
The trade-off is a visible reflow when the swap happens. The alternative, font-display: optional, avoids the flash by skipping the web font entirely if it is slow — better for Cumulative Layout Shift, worse for consistent branding.
swap is the right default. Change it if layout stability matters more to you than the font always appearing.
Preload the fonts used above the fold
Fonts are discovered late: the browser must fetch the CSS, parse it, and find the text that uses the font before it starts the download. For a heading font that appears at the top of the page, that delay is visible.
<link rel="preload" href="/fonts/lato-bold.woff2" as="font" type="font/woff2" crossorigin>
Preload only the one or two fonts actually visible without scrolling. Preloading everything competes with the rest of the page for bandwidth and makes things worse.
The crossorigin attribute is required even for same-origin fonts — without it the font is fetched twice.
Licence, including the embedding bits in the file
Worth repeating because it is the one thing conversion cannot fix. Beyond the written licence, TrueType and OpenType files carry an fsType embedding permission field, which the list shows per font. Values range from installable to restricted, where the foundry has marked the font as not for embedding at all.
- SIL Open Font License (Lato, Source Sans, most Google Fonts) — fine on any website.
- Commercial desktop licences — frequently exclude web use. A separate webfont licence is usually sold.
- Restricted embedding — do not put it on a site, regardless of how you obtained the TTF.
Converting a desktop-licensed commercial font to WOFF2 and serving it publicly is a licence breach, not a technical question.
Everything runs in your browser — the font files are never uploaded, which also matters for unreleased or custom-commissioned typefaces.