WOFF2
Embed This Widget
Add the script tag and a data attribute to embed this widget.
Embed via iframe for maximum compatibility.
<iframe src="https://fontfyi.com/iframe/glossary/woff2/" width="420" height="400" frameborder="0" style="border:0;border-radius:10px;max-width:100%" loading="lazy"></iframe>
Paste this URL in WordPress, Medium, or any oEmbed-compatible platform.
https://fontfyi.com/glossary/woff2/
Add a dynamic SVG badge to your README or docs.
[](https://fontfyi.com/glossary/woff2/)
Use the native HTML custom element.
Web Open Font Format 2.0 — Brotli-compressed, the most efficient font format for the web. ~30% smaller than WOFF, supported by all modern browsers.
WOFF2 (Web Open Font Format 2.0) is the most efficient font format available for web delivery today. It's supported by all modern browsers and should be your default choice when self-hosting fonts. Compared to its predecessor WOFF, WOFF2 achieves roughly 30% better compression on average — a significant saving when fonts are often one of the heavier resources on a page.
The compression improvement comes from WOFF2's use of the Brotli algorithm (the same algorithm used in HTTP/2 content compression), along with a preprocessing step that transforms the font's glyph data into a format that compresses more efficiently. The result is that a font that might be 200KB as a TTF file could be 60-80KB as WOFF2.
Using WOFF2 in CSS:
@font-face {
font-family: 'Inter';
src: url('/fonts/inter-regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
Modern simplified syntax (single format is sufficient):
@font-face {
font-family: 'Inter';
src: url('/fonts/inter-variable.woff2') format('woff2-variations');
font-weight: 100 900;
}
You no longer need to include WOFF or TTF fallbacks in your @font-face declarations. Browser support for WOFF2 covers all browsers that would run your modern CSS anyway — if a browser can handle CSS Grid, it can handle WOFF2.
Preloading WOFF2 for performance:
<link
rel="preload"
href="/fonts/inter-regular.woff2"
as="font"
type="font/woff2"
crossorigin
/>
The crossorigin attribute is required even for same-origin fonts — this is a quirk of how browsers handle font requests.
For variable fonts, WOFF2 supports the same glyph format as OpenType variable fonts, so a single WOFF2 file can replace an entire font family. Roboto Flex distributed as WOFF2, for example, replaces dozens of individual weight and width variants in a package that's still smaller than serving several static files.
When converting fonts to WOFF2, tools like fonttools (Python) or woff2 (Google's C++ encoder) produce the best compression. The pyftsubset tool from fonttools also lets you subset and convert in a single step, which is the most efficient workflow for production font pipelines.
相关术语
相关工具
展示此概念的字体
了解更多
一份实用清单,助你加快网页字体的加载速度——预加载、子集化、font-display,以及真正有效的现代最佳实践。
CSS 排版自托管 Google Fonts 能让你完全掌控加载、隐私和缓存。从下载到部署的分步指南。
CSS 排版关于使用 CSS 的 @font-face 加载自定义字体的分步教程——语法、格式选择,以及可直接复制粘贴的实用示例。
字体评测可变字体在一个文件中提供无限的灵活性。Google Fonts 上最好的可变字体——兼顾性能、设计灵活性与创作自由。