Icon Fonts 101
Everything you need to know about icon fonts — what they are, how they work, and which format to choose for your project.
What Are Icon Fonts?
Icon fonts are typefaces in which the glyphs — normally letters and numbers — are replaced with pictographic symbols. Instead of rendering the letter "A," an icon font renders a home icon, a search magnifier, or a shopping cart.
Because the icons live inside a font file, they behave exactly like text. You can scale them to any size with font-size, change their color with color, add text shadows, apply CSS transitions, and even animate them — all without touching a single image file.
This approach delivers several practical benefits:
- Resolution independence — vector outlines scale crisply on any screen density
- Tiny payload — one compressed font file replaces dozens of individual image assets
- CSS control — color, size, shadow, opacity, and hover states come free with text styling
- Single HTTP request — the entire icon set loads in one network round-trip
A brief history
In the early web, developers relied on individual images or CSS image sprites — large composite images where each icon occupied a fixed rectangular region. Sprites reduced HTTP requests but were brittle: adding or resizing an icon meant regenerating the entire sprite sheet and updating pixel offsets by hand.
Around 2012, projects like Font Awesome and IcoMoon popularized a cleaner alternative: packaging icons as font glyphs mapped to Unicode's Private Use Area. Designers could swap an entire icon set by changing one @font-face declaration, and developers could style icons with the same CSS they already used for text. The technique spread rapidly and remains a reliable, low-overhead choice for design systems that use single-color iconography.
Icon Fonts vs SVG Icons
The "icon fonts vs inline SVG" debate has been a staple of front-end discussions for over a decade. Both approaches are valid — the right choice depends on your project's requirements.
Icon Fonts
- Single HTTP request — one font file delivers every icon
- Dead-simple CSS styling — change
color,font-size, andtext-shadowlike any text - Monochrome only — each glyph supports a single fill color
- Easy drop-in — add a stylesheet link, use a CSS class, done
Inline SVG
- Multi-color — each path can have its own fill, stroke, or gradient
- Accessible by default —
<title>andaria-labelgive screen readers real semantics - Individually cacheable — unused icons are never downloaded
- Fine-grained control — animate individual paths, apply filters per element
SVG Sprites
- Combine multiple SVGs into a single
<symbol>sprite sheet - Reference icons with
<use href="#icon-name"> - Offers the benefits of both — single request, multi-color, accessible — but requires a more involved build pipeline
Format Comparison
Icon fonts can be packaged in five file formats, each with different compression, browser support, and use cases. Here is how they compare at a glance:
| Format | Compression | File Size | Browser Support | Best For |
|---|---|---|---|---|
| .woff2 | Brotli | Smallest | 97%+ | Modern web (recommended) |
| .woff | zlib | Small | 98%+ | Wide compatibility fallback |
| .ttf | None | Medium | 98%+ | Desktop apps, development |
| .svg | None | Largest | Limited | Legacy iOS, debugging |
| .eot | Optional | Medium | IE only | IE 6-8 legacy support |
Choosing the Right Format
Not sure which formats to include? Use this practical decision guide:
- If you only pick one — ship WOFF2. It offers the best compression (Brotli) and covers 97%+ of browsers.
- If you need IE 11 support — ship WOFF2 + WOFF. WOFF handles the remaining browsers that lack Brotli decoding.
- If you need IE 8 support — ship WOFF2 + WOFF + EOT. EOT is the only format understood by Internet Explorer 6-8.
- For desktop applications — use TTF. It is the native format for OS-level font rendering on Windows, macOS, and Linux.
- For debugging font issues — inspect the SVG Font. Its XML structure is human-readable, making it easy to verify glyph paths and metadata.
Explore by Format
Dive deeper into each format to understand its internals, browser compatibility, and best practices:
Learn how to use these formats in your projects: