Font Subsetter & WOFF2 Converter (keep only the characters you use to shrink web fonts / convert TTF and OTF to WOFF2)
Completely free, with no extra charges. You may freely use the output commercially.
About this tool
This tool is for anyone who puts web fonts on a site or app and wants to turn a multi-megabyte CJK or Latin font into a small WOFF2 that contains only the characters a page actually uses. For a typeface used only for headings or a logo, a font of several MB can drop to a few dozen KB, cutting both loading time and data transfer. There is no need to install Python’s pyftsubset or similar tools.
You can choose the characters to keep by pasting text, loading HTML or text files, ticking character sets such as ASCII, Latin-1 or Japanese kana and kanji, or entering Unicode ranges. Keep every character and it simply converts TTF or OTF to WOFF2. Variable fonts can be made lighter by pinning axes such as weight to a single value, and the tool writes ready-to-use @font-face CSS (with unicode-range). Subsetting is done with the WebAssembly build of HarfBuzz (the text-shaping library used by many browsers and operating systems). All processing happens entirely in your browser (no data is sent).
1. Choose font files
Drop .ttf / .otf / .woff files here or choose them with the button. Choose several, such as Regular and Bold, to subset them all with the same characters at once.
2. Decide which characters to keep
3. Choose the output format and create
Advanced settings
Created fonts
How to use it and how subsetting works
Steps to make a heading font lighter
- Choose the TTF or OTF of the font you want to use. For a Google Fonts typeface, the ZIP you get from “Get font” → “Download all” on its page contains static TTFs for each weight in the static folder and the variable-font TTF.
- Paste the text this font will display (headings, logo, menus and so on), or load your site’s HTML files. If you worry about missing characters as more articles are added later, also tick the character sets your language needs, or enter its Unicode range.
- Press “Create subset” to see the original size, the new size and the number of characters kept. Check that the text in the preview box appears in the intended typeface, then save the font.
- Put the font in your site’s
fonts/folder and paste the displayed CSS into your stylesheet. Use the name you set infont-familyfor headings and other elements.
For example, keeping only the 18 characters of “フォントのサブセット化ABCabc、。” from a Japanese Gothic TTF (about 6 MB, a little over 11,000 characters) produced a WOFF2 of about 2 KB (with the default of removing hinting). Even for body text, narrowing the set to what your language really uses makes the font far smaller than the full version.
Why the file gets smaller
Chinese, Japanese and Korean fonts hold thousands to tens of thousands of glyphs, so a single style weighs several MB; even Latin fonts that cover Greek, Cyrillic and Vietnamese can reach hundreds of KB. On a page that uses a web font, the browser cannot show text in the intended typeface until it has downloaded the whole file. Subsetting creates a new font that keeps only the glyphs for the specified characters and the tables needed to display them (character-to-glyph mapping, advance widths, kerning, vertical forms and so on). WOFF2 then compresses the font data with Brotli, making it much smaller than a TTF with the same content.
Even when you keep a whole set of characters (for example, all of Latin-1), the tool automatically drops characters the font does not contain and lists the requested characters that are missing from it. The unicode-range in the generated CSS lists only the characters actually kept.
Pinning the axes of a variable font
Variable fonts such as Inter or Noto Sans can express everything from thin to black in one file, but the data used to change weight (the gvar table and so on) makes them larger. If your site uses only weights 400 and 700, create one font pinned at 400 and one pinned at 700, and each becomes as small as an ordinary static font. When you choose a font, its axes (wght, wdth, opsz and so on) and their ranges are listed; enter a number in “Pin to value”. Axes left variable are written as a range in CSS font-weight.
Things to note
- Whether you may modify a font and serve it on the web depends on its license. Fonts under the SIL Open Font License (OFL) can be subset and served from your own site, but if the font declares a Reserved Font Name, modified versions you distribute must not use that name. Commercial fonts and fonts bundled with an operating system often do not allow web-font use, so check the license you received with them. When you choose a font, the tool shows the license text recorded in the font and its embedding permission (fsType).
- Supported input is TTF, OTF (including CFF and CFF2) and WOFF. WOFF2 and TTC (font collections) cannot be loaded.
- If you use a heavily trimmed font where the text is not known in advance, such as input forms, comment sections or articles added later, only the missing characters fall back to another typeface. In such places, keep a broader set of characters or use the operating system’s fonts.
- WOFF2 is compressed with Brotli without the glyf table transform (an optional step that makes files even smaller). As a result, files can be a few percent to a little over ten percent larger than the WOFF2 served by Google Fonts and similar services.
- Without hinting, strokes may look uneven when small text is rendered by older Windows rendering modes. If that bothers you, turn the option off in the advanced settings.
Related tools
To create a full set of site icons, use the Favicon Generator; to find zero-width spaces and similar characters hidden in your text, use the Invisible Character Checker.
Font subsetting uses harfbuzzjs 1.6.4 (MIT; HarfBuzz is under the Old MIT license), and WOFF2 compression uses the WebAssembly build of brotli-wasm 3.0.1 (Apache-2.0), both hosted on this site. The license texts are at harfbuzzjs, HarfBuzz and brotli-wasm.