Course contentsShow
← Web Development
Lesson 560 of 2,98210. Typography and Design SystemsFree lesson

Font File Formats: WOFF2, WOFF, TTF, EOT

Compare modern and legacy font formats, understanding when and why to use each.

Font File Formats: WOFF2, WOFF, TTF, EOT

You'll learn: How to choose the right font format for modern browsers while supporting older ones.

Understanding Font Formats

When you use @font-face, you specify font files in different formats. Think of these formats like different compression methods for the same photo—each optimized for different situations and browser generations.

Modern Formats

WOFF2 (Web Open Font Format 2) is the champion for modern web development. It offers the best compression (30-50% smaller than WOFF) and loads fastest. All modern browsers support it.

WOFF (Web Open Font Format) is WOFF2's older sibling. It's more compressed than TTF but less than WOFF2. Use it as a fallback for slightly older browsers (IE9-11, older mobile browsers).

Legacy Formats

TTF (TrueType Font) is the original desktop font format. It's larger and unoptimized for the web, but works on very old Android browsers. Think of it as the uncompressed "raw" version.

EOT (Embedded OpenType) was Microsoft's proprietary format, only needed for IE6-8. Unless you're supporting ancient Internet Explorer, you can skip this entirely.

When to Use Each

For modern projects, WOFF2 is your primary choice. Include WOFF as a fallback for broader compatibility. You might structure your @font-face like this concept:

@font-face {
  font-family: 'MyFont';
  src: url('myfont.woff2') format('woff2'),
       url('myfont.woff') format('woff');
}

The browser tries WOFF2 first, then falls back to WOFF if unsupported.

Key Takeaway: Use WOFF2 for modern browsers (smallest files, fastest loading), add WOFF for broader support, and skip TTF/EOT unless you must support legacy browsers or devices.