# WOFF2: The Web Font Format You Should Be Using ![WOFF (1)](https://hackmd.io/_uploads/rk-GGmRo-e.png) If you have ever looked at how fonts are loaded on a modern website, you have probably come across the `.woff2` file extension. It shows up in CSS stylesheets, browser developer tools, and font download packages, but most people who encounter it do not fully understand what it is, why it exists, or why it has become the dominant format for web typography. This guide covers everything you need to know about WOFF2, from what the format actually is to how it compares to older formats and how to convert your existing fonts into it. Whether you are a designer setting up a new project, a developer optimizing an existing site, or just someone trying to understand what these file extensions mean, this is the complete picture. --- ## What Is WOFF2? ![2026-04-04_10-06-39](https://hackmd.io/_uploads/HJxrzmAobl.png) WOFF2 stands for **Web Open Font Format 2**. It is a font file format designed specifically for use on the web, developed by the W3C (World Wide Web Consortium) and published as a standard in 2018. The format is built on top of existing font technology — specifically TrueType and OpenType fonts — but adds a compression layer that makes the files significantly smaller and faster to load over a network. The core innovation in WOFF2 is its use of **Brotli compression**, an algorithm developed by Google that is specifically optimized for compressing structured data like font files. Compared to the zlib compression used by its predecessor WOFF, Brotli typically reduces file sizes by an additional 30 percent or more. For a font that might be 150 kilobytes as a TTF file, the WOFF2 version might come in at 60 to 80 kilobytes, sometimes less. That size reduction has a direct impact on page load times, which in turn affects user experience and search engine rankings. For any site that uses custom fonts, switching to WOFF2 is one of the most straightforward performance improvements available. --- ## A Brief History of Web Font Formats To understand why WOFF2 matters, it helps to understand the problem it was designed to solve. In the early days of the web, typography was extremely limited. Websites could only use fonts that were installed on the visitor's operating system, which meant designers were restricted to a handful of system fonts like Arial, Times New Roman, and Georgia. Creative typography was simply not possible on the web. The introduction of the CSS `@font-face` rule changed this, allowing websites to load custom font files directly. But early implementations had significant problems. Different browsers supported different font formats, leading to a fragmented landscape where web developers had to serve multiple versions of the same font to cover all browsers. The formats involved included: - **TTF** and **OTF** for some browsers - **EOT** (Embedded OpenType) for Internet Explorer - **SVG fonts** for older versions of iOS Safari - **WOFF** for modern browsers Managing all of these simultaneously was complicated and resulted in unnecessarily large page weights. WOFF was introduced in 2010 to simplify this. It provided a single format with broad browser support and better compression than raw TTF or OTF files. WOFF2 followed as an improvement on WOFF, offering better compression and becoming the new standard. Today, browser support for WOFF2 is essentially universal among modern browsers, and the old formats are largely unnecessary for new projects. --- ## WOFF2 vs Other Font Formats Understanding how WOFF2 compares to other formats helps clarify when and why to use it. ### WOFF2 vs TTF TTF (TrueType Font) is a desktop font format with no compression. It is the raw source format in which many fonts are distributed. While browsers can technically load TTF files directly, doing so is inefficient. A TTF file might be two to three times larger than the equivalent WOFF2, which means slower load times and more bandwidth usage. TTF should not be used as a web font format in new projects. ### WOFF2 vs OTF OTF (OpenType Font) is similar to TTF in that it is a desktop format without web-specific compression. OTF files can contain more advanced typographic features than TTF, but like TTF they are not compressed for web delivery. Converting an OTF to WOFF2 before serving it on the web is the correct approach. ### WOFF2 vs WOFF WOFF is the direct predecessor to WOFF2. It uses zlib compression rather than Brotli, resulting in files that are typically 20 to 30 percent larger than their WOFF2 equivalents. WOFF still has slightly broader browser support than WOFF2 in absolute terms, but WOFF2 is supported by all browsers that matter for modern web development. WOFF is worth including as a fallback in your CSS font stack for maximum compatibility, but WOFF2 should always be listed first. ### WOFF2 vs SVG Fonts SVG fonts are an old format used primarily for early versions of iOS Safari. They are large, limited in capability, and no longer necessary. There is no reason to include SVG fonts in a modern web project. ### WOFF2 vs EOT EOT (Embedded OpenType) was Microsoft's proprietary format for Internet Explorer. It is completely obsolete and only relevant if you need to support IE, which for most projects is no longer a requirement. --- ## Browser Support for WOFF2 ![image](https://hackmd.io/_uploads/HJZ4XXAi-e.png) WOFF2 is supported by all modern mobile and desktop browsers, including Chrome, Firefox, Safari, Edge, and Opera. According to browser usage data, WOFF2 support covers well over 95 percent of global web users. The only scenarios where WOFF2 support might be a concern are very old browser versions or specialized environments like certain embedded browsers in older operating systems. For these edge cases, including WOFF as a fallback in your `@font-face` declaration is sufficient. --- ## How to Use WOFF2 on Your Website Using WOFF2 on a website involves two main steps: getting the font files in WOFF2 format, and writing the CSS to load them correctly. ### Getting WOFF2 Files If you are using Google Fonts, WOFF2 files are served automatically when you use the standard embed code. You do not need to do anything manually. ![image](https://hackmd.io/_uploads/Bkbp7XRs-x.png) If you are self-hosting fonts, you will need to convert your source font files to WOFF2. Starting from a TTF or OTF file, you can use an online converter to generate the WOFF2 output. The [WOFF2 converter](https://font-converters.com/convert-to/woff2-font-format) handles this directly in the browser with no software installation required. Upload your TTF or OTF file and download the resulting WOFF2, ready to deploy. ### Writing the CSS Once you have your WOFF2 file, you need to tell the browser how to load it using the `@font-face` rule. A standard declaration looks like this: ```css @font-face { font-family: 'YourFont'; src: url('/fonts/yourfont.woff2') format('woff2'), url('/fonts/yourfont.woff') format('woff'); font-weight: normal; font-style: normal; font-display: swap; } ``` A few things to note here. WOFF2 is listed first in the `src` stack because the browser will use the first format it supports. Including WOFF as a second option provides a fallback for browsers that do not support WOFF2, though in practice this covers an extremely small percentage of users today. The `font-display: swap` property is important for performance. Without it, the browser may delay rendering text until the font has fully loaded, causing what is known as a **Flash of Invisible Text (FOIT)**. Setting it to `swap` tells the browser to show a fallback font immediately and replace it with your custom font once it is ready. After defining the font face, you apply it in your styles like any other font: ```css body { font-family: 'YourFont', Arial, sans-serif; } ``` Always include system font fallbacks at the end of your font stack in case the web font fails to load for any reason. --- ## Performance Best Practices for WOFF2 Using WOFF2 is a good start, but there are additional steps you can take to ensure your fonts load as efficiently as possible. ### Preload Your Primary Font Adding a preload hint in your HTML `<head>` tells the browser to fetch the font file early in the page load process, before it would normally discover it while parsing your CSS. This can meaningfully reduce the time before your custom font appears. ```html <link rel="preload" href="/fonts/yourfont.woff2" as="font" type="font/woff2" crossorigin> ``` Only preload the font you use most — typically your regular weight body font. Preloading too many fonts can actually hurt performance by competing for bandwidth with other critical resources. ### Subset Your Fonts A full font file contains glyphs for hundreds or thousands of characters across multiple languages and scripts. If your website only uses English, you are loading a lot of data you do not need. Font subsetting removes unused characters from the file, which can reduce file size dramatically. Many webfont generators include a subsetting option. Be careful not to subset too aggressively if your site includes any special characters, currency symbols, or content in multiple languages. ### Limit the Number of Weights and Styles Every font weight and style is a separate file and a separate HTTP request. Loading regular, italic, bold, and bold italic versions of a font means four separate WOFF2 files. For most websites, regular and bold is sufficient. Adding more weights should be a deliberate decision based on your design needs, not a default. ### Use font-display Consistently Apply `font-display: swap` to every `@font-face` declaration in your stylesheet, not just your primary body font. Inconsistent font display settings can cause layout shifts on pages where different fonts load at different speeds. A full breakdown of optimization techniques and tools is available at [font-converters.com](https://font-converters.com) if you want to explore beyond what is covered here. --- ## WOFF2 and Self-Hosting One of the most common reasons to work directly with WOFF2 files is self-hosting. Rather than loading fonts from a third-party service like Google Fonts, self-hosting means serving the font files directly from your own server or CDN. Self-hosting has several advantages: - It eliminates third-party requests, which is relevant for privacy compliance under GDPR and similar regulations. - It gives you full control over caching, compression, and delivery. - It removes any dependency on the availability of external services. The practical details of the WOFF2 format, including its structure, metadata, and browser parsing, are covered in depth in the [WOFF2 format guide](https://font-converters.com/formats/woff2), which is a useful reference if you need to go deeper than the basics covered here. --- ## Common WOFF2 Mistakes to Avoid **Serving TTF or OTF directly instead of WOFF2.** This is the most common mistake and has the biggest performance impact. Always convert to WOFF2 before deploying. **Not including a WOFF fallback.** While WOFF2 support is very broad, including WOFF as a fallback adds compatibility without meaningful cost. **Forgetting `crossorigin` on preload tags.** Font preload hints require the `crossorigin` attribute even when the font is served from the same domain. Without it, the browser may fetch the font twice. **Using WOFF2 files converted from low-quality sources.** The quality of your WOFF2 output depends on the quality of your source file. Always convert from the original TTF or OTF provided by the font designer, not from another web font format. **Not testing load behavior.** Use your browser's developer tools to check that fonts load correctly, that WOFF2 is served rather than a fallback format, and that there are no unnecessary duplicate requests. --- ## Conclusion: Use WOFF2 For Websites WOFF2 is not complicated, but it is important. It is the format that makes custom web typography practical without sacrificing performance, and understanding how to use it correctly is a fundamental skill for anyone working on the web today. The process is straightforward: start with a quality TTF or OTF source file, convert it to WOFF2, write clean `@font-face` CSS with a WOFF fallback and `font-display: swap`, and optimize with preloading and subsetting where appropriate. Done right, your fonts will load fast, render consistently across browsers, and give you full control over your typography without relying on third-party services.