TTF · OTF · WOFF · WOFF2 · subsetting

Font Converter and Subsetter

Open a font, keep only the characters you need, and write web-ready files with the size before and after and a matching @font-face rule.

Font

TTF, OTF, WOFF or WOFF2 up to 20.00 MB

Drop a font here or click to choose

One font per run; .ttc collections are not read.

Keep

Character sets

203 characters requested.

Write

About this font

Open a font to see its names, coverage and embedding permissions.

Font Converter and Subsetter

Operator: Abdulla Al Fahad. How tools are built and checked

A font file carries thousands of glyphs, kerning pairs and hinting programs, and a page that sets headings in Latin letters needs a few hundred of them. Cutting the rest away is called subsetting, and it is usually the difference between a 126 KB download and an 11 KB one.

Key features

  • Opens TTF, OTF, WOFF and WOFF2 and writes any mix of them, with the outline type (TrueType or CFF) kept as it was
  • Subsets with HarfBuzz's own subsetter, run as WebAssembly in a worker you can cancel
  • Character sets for Latin, Latin Extended, Vietnamese, Greek, Cyrillic, digits and punctuation, plus your own U+ ranges and the characters of a pasted text
  • Layout features: keep the default set, keep all, choose from the tags the font has, or drop them all
  • Size before and after for each format, an @font-face rule with a unicode-range, and a ZIP of everything

What changes inside the font

A subset keeps the glyphs for the characters you ask for, plus the glyphs those need through substitution (an fi ligature glyph stays if f and i do and the liga feature is kept), and rebuilds the cmap, hmtx, loca or CFF data and the layout tables around them. Glyph indexes are renumbered, so a subset is a new font, not a view of the old one.

The container is separate from the outlines. WOFF wraps each table with zlib, WOFF2 compresses all tables together with Brotli after a transform of the glyph data, and both unwrap to an equivalent TTF or OTF; the WOFF2 glyph transform does not round-trip byte for byte, so expect the same glyphs and tables but not an identical file. This page converts between the containers freely; it cannot turn TrueType outlines into CFF or the reverse, so the plain file is .ttf or .otf according to the font's own outlines.

How it works

WOFF input is unpacked table by table with a running cap on the real inflated bytes, whatever the header declares, and a font that expands beyond 64 MB or beyond its own declared size is refused. WOFF2 input is unpacked by the wawoff2 build served from this site. The unpacked font is read for its names, glyph count, mapped characters and layout feature tags.

Subsetting loads harfbuzz-subset.wasm, which is also served from this site, and passes it the code points, the feature tags to keep, the no-hinting flag and the name-table sets. The page then reads the result back to count glyphs and mapped characters and to tell you how many of your requested characters the font did not have.

Common use cases

  • A landing page uses one headline font at two weights. Subsetting each to the Latin set drops two WOFF2 files from about 45 KB each to about 11 KB each, and the unicode-range line lets browsers skip the file for pages in other scripts.
  • A print-on-demand site lets customers type a name in a custom font. A Cyrillic preset plus the Latin preset produces one file that covers both alphabets without shipping the full font.
  • A Vietnamese recipe blog sets its headings in a font whose plain Latin set lacks letters such as ơ, ư and the stacked tone marks. Ticking Vietnamese alongside Latin adds them, and pasting a finished post as text reports how many of its characters the font cannot draw before anything is published.

How to use this tool

  1. Drop the font and read the names, coverage and embedding line in About this font.
  2. Choose Subset or Convert only, then tick character sets, add ranges or paste your text.
  3. Pick which formats to write and press the button; then download single files or the ZIP, and paste the CSS next to them.

Example

Geist-Regular.ttf (125,956 bytes, SIL Open Font Licence) with the Latin set, hinting dropped, default features

Mode: Subset, Character sets: Latin, Layout features: default, Drop hinting: on, Keep every name record: on

Result table

TTF 27,784 B, WOFF 14,300 B, WOFF2 10,920 B (91.3% smaller than the original)
262 glyphs, 202 characters; 1 requested character not in the font (U+00AD, soft hyphen)
Features kept: ccmp, dnom, frac, kern, liga, locl, numr
Pasting the text "Hello, world" instead gives 10 glyphs and a 1,396-byte WOFF2

Tips for best results

  • Paste the actual strings of a fixed page (a logo wordmark, a price list) rather than a whole alphabet: a nine-letter wordmark needs ten glyphs counting .notdef, so its TTF is a few kilobytes against the 126 KB original.
  • Keep the liga and kern features for body text. Drop all features only for a font that shows digits or a short fixed word, where no substitution can happen.
  • A variable font stays variable: its axes are kept as they are, so the file is much bigger than a single static weight.

Edge cases to watch

Subsetting cannot add characters later. Keep the original file so a new language means a new subset from the full font.

A font that maps a character through a layout rule you dropped (Arabic joining forms, Indic conjuncts) will render wrongly if you drop those features; keep all features for complex scripts.

Common errors and how to fix them

"Font collections (.ttc) hold several fonts"
Extract one font from the collection with a font tool, then open the single file.
"The WOFF file expands beyond its declared size"
The file is damaged or hostile. Download it again from its source.
"The font could not be subset"
The subsetter rejected a table. Try Convert only, or keep all layout features.

Best practices

  • Subset one file per script and let unicode-range choose: the browser fetches only the files whose ranges occur in the page's text.
  • Preload only the WOFF2 of the font used above the fold, with as="font", type="font/woff2" and crossorigin, because font requests are always made in anonymous CORS mode.

Embedding permissions in the OS/2 table

The OS/2 table's fsType field records what the font's licensor allows: 0 is installable embedding, bit 1 forbids embedding, bit 2 allows preview and print only, bit 3 allows editable embedding, bit 8 asks that the font is not subset and bit 9 allows bitmaps only. The page shows these and asks for a tick before it works on a font that forbids embedding or asks for no subsetting. It reports what the file says; it cannot tell you what licence you actually hold.

Frequently asked questions

Why is the WOFF2 smaller than the WOFF of the same subset?

WOFF2 compresses the tables as one stream with Brotli and first rearranges the glyph data into a form that compresses better. In the example above the same subset is 14,300 bytes as WOFF and 10,920 as WOFF2.

Does converting to WOFF2 change the licence of a font?

No. A converted file carries the same name records, including the licence text if you keep them, and the same fsType bits. Check the licence text shown beside the font before you self-host it.