TTF to WOFF2 — The Font Conversion Every Web Developer Needs
Convert TTF desktop fonts to WOFF2 for the web. 30-50% smaller, faster loading, better compression. How it works and the best tools.
Why Your Website Shouldn't Be Serving TTF Fonts
If your CSS looks like this:
@font-face {
font-family: 'CustomFont';
src: url('/fonts/custom.ttf') format('truetype');
}
You're sending 30-50% more data than necessary on every page load. TTF (TrueType Font) was designed for desktop operating systems in 1991. WOFF2 (Web Open Font Format 2) was designed for the web in 2018.
The difference is dramatic:
| Font | TTF Size | WOFF2 Size | Savings |
|---|---|---|---|
| Inter Regular | 312 KB | 98 KB | 69% |
| Roboto Regular | 168 KB | 64 KB | 62% |
| Open Sans Regular | 217 KB | 87 KB | 60% |
| Source Code Pro | 195 KB | 72 KB | 63% |
| Custom display font | 85 KB | 38 KB | 55% |
How WOFF2 Achieves This
WOFF2 uses Brotli compression — the same algorithm Chrome uses for HTTP compression. But it doesn't just blindly compress the font file. The WOFF2 encoder includes font-specific preprocessing:
- Table restructuring: Reorganizes font tables for better compression
- Glyph data transformation: Specialized delta encoding for outline data
- Brotli compression: General-purpose compression on the preprocessed data
Browser Support: Universal
As of 2026, WOFF2 is supported by every browser that matters:
| Browser | WOFF2 Support Since |
|---|---|
| Chrome | 2014 (v36) |
| Firefox | 2015 (v39) |
| Safari | 2015 (v10) |
| Edge | 2015 (v14) |
| Opera | 2014 (v23) |
| Samsung Internet | 2015 |
| iOS Safari | 2015 (iOS 10) |
How to Convert
Online Tools
MyPDF's font converter handles TTF to WOFF2. Other options include Font Squirrel's Webfont Generator (excellent, with subsetting) and Transfonter. Desktop tools like FontForge (free, open-source) also handle this conversion.Command Line
Font Squirrel Webfont Generator (free, web-based): Upload your TTF → Choose WOFF2 → Download. Also supports subsetting (removing unused characters) during conversion — more on that below. Transfonter (free, web-based): Another solid option with subsetting, format selection, and Unicode range control. MyPDF Font Converter: Quick online conversion for single files or small batches.For Web Developers
Pre-convert your fonts and commit the WOFF2 files to your project. Most modern build tools (webpack, Vite) can serve WOFF2 as static assets.
Subsetting: The Real Performance Win
Converting TTF to WOFF2 saves 50-70%. But subsetting — removing characters you don't use — can save 90%+.
A typical font file contains glyphs for Latin, Cyrillic, Greek, Vietnamese, and various symbols. If your website is English-only, you only need Basic Latin and maybe Latin Extended.
In Font Squirrel's generator, check "Subsetting" and select "Latin" under character sets. The results are dramatic — here's Inter Regular as an example:
| Version | Size |
|---|---|
| TTF (full) | 312 KB |
| WOFF2 (full) | 98 KB |
| WOFF2 (Latin subset) | 18 KB |
From 312 KB to 18 KB — a 94% reduction — with no visible difference for English-language sites.
The @font-face Declaration (Best Practice)
@font-face {
font-family: 'CustomFont';
src: url('/fonts/custom.woff2') format('woff2');
font-display: swap;
font-weight: 400;
font-style: normal;
unicode-range: U+0000-00FF, U+0131, U+0152-0153; / Latin /
}
Key details:
- Only WOFF2: No need for TTF/WOFF fallbacks in 2026
- font-display: swap: Shows fallback font while custom font loads (prevents invisible text)
- unicode-range: Browser only downloads the font if the page uses characters in this range
Variable Fonts: One File to Rule Them All
If your font family has multiple weights (Regular, Bold, Light, etc.), each weight is traditionally a separate file. Variable fonts combine all weights (and sometimes widths/italics) into a single file:
| Approach | Files | Total Size (WOFF2) |
|---|---|---|
| Static (Regular + Bold) | 2 | 180 KB |
| Static (4 weights) | 4 | 360 KB |
| Variable (all weights) | 1 | 120 KB |
Frequently Asked Questions
Can I convert WOFF2 back to TTF?
Yes, it's lossless. The conversion is just compression — no glyph data is lost. Any WOFF2 file can be converted back to the original TTF.Do Google Fonts serve WOFF2?
Yes, automatically. When you use Google Fonts, the CDN serves WOFF2 to all modern browsers. But self-hosting WOFF2 files is better for performance (one fewer DNS lookup) and GDPR compliance.What about font licensing?
Converting a font format doesn't change its license. A font licensed for desktop use may not be licensed for web embedding. Always check the font license before serving it on a website. Most popular open-source fonts (Inter, Roboto, Open Sans) allow web use.Does WOFF2 support color/emoji fonts?
Yes. WOFF2 supports all OpenType features including COLRv1 color fonts. Emoji fonts and multi-color display fonts work fine in WOFF2.Related Tools
- Font Converter — Convert between font formats
- Compress PDF — Optimize PDFs with embedded fonts
- HTML to PDF — Generate PDFs with custom web fonts