Skip to content
The Font World
Pairings Free Fonts Guides Web Type Spotlight About
Web Typography

What Is Font Subsetting?

Font subsetting means shipping only the glyphs your page needs, not the full character set. Learn how it shrinks web fonts and speeds up your page loads.

Quick answer: Font subsetting means creating a smaller font file that contains only the glyphs you actually need, instead of the full character set. Removing unused characters, scripts and OpenType features can shrink a web font dramatically, which speeds up downloads and improves page load times.

A full font file is often far larger than a single web page needs. A typeface may carry glyphs for dozens of languages, multiple scripts, symbols, ligatures and alternate characters — thousands of glyphs in total. If your page only shows English text, almost all of that is dead weight the visitor still has to download. Subsetting is the process of stripping a font down to just the glyphs a project uses.

What subsetting actually removes

A subsetter can drop several kinds of data:

  • Unused glyphs — characters for languages or scripts you do not use (Cyrillic, Greek, Vietnamese, CJK, and so on).
  • Unused OpenType features — optional typographic features such as rare ligatures, stylistic sets, or old-style figures you are not applying.
  • Metadata and hinting — in aggressive subsets, some auxiliary tables can be trimmed, though this should be done carefully.

The result is a font file that renders exactly the same for the text you display, but weighs a fraction of the original.

How much does it save?

The savings depend heavily on the original font and how much you remove. A large multi-script family might ship with glyphs for many languages; a Latin-only subset of that can be a small fraction of the full size. Combine subsetting with WOFF2 compression and the final file served to the browser can be very small compared with the raw desktop font. There is no single universal percentage — the honest answer is to subset your own font and compare the before and after sizes.

Unicode-range subsetting

Google Fonts and many services use a smart variant: they split a font into several subset files by Unicode range (Latin, Latin-Extended, Cyrillic, Greek, and so on) and declare each with the CSS unicode-range descriptor in @font-face. The browser then downloads only the subsets whose characters actually appear on the page. If your content is all basic Latin, only the Latin subset is fetched.

A simplified example:

@font-face { font-family: 'MyFont'; src: url('myfont-latin.woff2') format('woff2'); unicode-range: U+0000-00FF; }

This is a good default for self-hosting, because it keeps the initial download tiny while still supporting other languages on demand.

How to subset a font

Common tools include:

  • fonttools (the pyftsubset command) — the open-source Python toolkit most pipelines rely on. You can specify exactly which characters, Unicode ranges or OpenType features to keep.
  • glyphhanger — crawls your site to detect which characters you actually use, then drives pyftsubset to build a matching subset.
  • Online subsetters — browser-based tools that let you tick the languages and features you want.

A typical pyftsubset run keeps a specific set of Unicode characters, outputs WOFF2, and preserves layout features you still need.

Licensing and cautions

Subsetting modifies the font file, so check the font licence first. Many open-source licences (such as the SIL Open Font License) explicitly permit modification and redistribution within their terms, while some commercial web font licences restrict what you may alter or self-host. Never subset or redistribute a font you do not have the right to modify.

Be conservative about what you strip. If you remove a script and later add content in that language, the characters will fall back to a system font or show as missing glyphs. For dynamic or user-generated content, prefer unicode-range subsets that still cover the languages your users might type, rather than a razor-thin character-only subset.

A practical subsetting workflow

A reliable self-hosting workflow looks like this. First, decide which languages and characters your site genuinely needs — or let a tool like glyphhanger scan your pages and report the exact characters in use. Second, run the subsetter to produce one or more .woff2 files, keeping the OpenType features you actually apply (kerning and standard ligatures are usually worth keeping). Third, declare the subsets in CSS with unicode-range so the browser fetches only what each page needs. Fourth, preload the single most important subset so its download starts early. Finally, test real content in the browser to confirm no characters are falling back or showing as missing-glyph boxes.

Subsetting and variable fonts

Variable fonts pack many weights and styles into one file by storing interpolation axes rather than separate files per weight. They can be subset too — you can drop unused glyphs just as with a static font — but be cautious about removing named instances or axes you rely on. In many cases a single subset variable font replaces a whole stack of static weight files, which is its own form of savings. Whether a variable font or a few subset static weights is lighter depends on how many weights you use; test both for your specific case.

When subsetting matters most

Subsetting delivers the biggest wins when you use large families, multiple weights, or scripts with huge glyph counts such as CJK fonts, where full files can run into megabytes. For a single Latin weight that is already small, the gain is modest but still worthwhile. In every case it pairs naturally with WOFF2 compression, preloading and a sensible font-display value — the four techniques together are the core of fast, self-hosted web fonts. Think of it as a pipeline: subset to remove what you do not need, compress what remains, deliver it early, and control how it paints.

Frequently asked questions

Does subsetting change how the font looks?

No. For the characters you keep, the glyphs are identical to the original font. Subsetting only removes glyphs and data you are not using, so the text you display renders exactly the same while the file gets smaller.

What is the difference between subsetting and compression?

Subsetting removes glyphs you do not need, reducing how much is in the file. Compression (such as WOFF2’s Brotli) shrinks whatever is left. They are complementary: subset first to drop unused glyphs, then compress to WOFF2 for the smallest possible download.

Is unicode-range subsetting better than one subset file?

For multilingual sites, yes. Splitting by Unicode range lets the browser fetch only the subsets whose characters appear on the page, so a reader seeing English text never downloads the Cyrillic or Greek subset. For a strictly single-language site, one well-made subset is simpler.

Can I subset any font?

Technically most font files can be subset, but you must have the legal right to modify them. Check the licence: open licences like the SIL OFL generally allow it, while some commercial licences restrict modification or self-hosting. When in doubt, use the foundry’s own web font service.

Do Google Fonts already come subset?

Yes. When you embed Google Fonts via their CSS, the service automatically serves Unicode-range subsets and WOFF2, downloading only what the page needs. If you self-host the files instead, you take on the subsetting yourself.