Webfont Converter (TTF/OTF to WOFF2)
Turn desktop fonts into small web fonts with matching CSS — nothing is uploaded.
Fonts
Output
Converted files
| File | Size | Change | Download |
|---|
Loaded from the converted files
CSS (fonts.css in the ZIP)
About the Webfont Converter (TTF/OTF to WOFF2)
Turn TrueType (.ttf) and OpenType (.otf) fonts into the formats websites use: WOFF2, the smallest, which every current browser reads, and WOFF for browsers that predate it. It also works the other way, unpacking WOFF and WOFF2 files back to TTF or OTF so you can install them. Add every style of a family at once and you get one ZIP with the converted files, a fonts.css with an @font-face rule for each style (weight, style, width and font-display filled in from the font), and a note of each font’s copyright and licence.
To make the files smaller still, subset them: keep only Latin, Latin Extended, Vietnamese, Cyrillic, Greek or Devanagari, or just the characters you type, with HarfBuzz’s hb-subset. Split by range and the CSS gets unicode-range descriptors, so browsers download only the files a page needs. Each converted file is loaded back into your browser before you download it, so you see that it works. Everything runs on your device; the fonts never leave it.
How to use it
- Choose or drop your font files — TTF, OTF, WOFF, WOFF2 or a TTC collection, every style of a family together.
- Read the licence notes under each font: they flag fonts whose embedding setting or licence may not allow web use.
- Pick the formats: WOFF2 for the web, WOFF only for very old browsers, TTF / OTF to install a web font on a computer.
- Optionally choose Subset and tick the character ranges (or type the characters) to keep; tick One file per range to split them with
unicode-range. - Set the
font-familyname,font-displayand the folder your CSS will point to, then press Convert. - Check the samples drawn with the converted files, then download the ZIP (or single files) and copy the CSS.
Examples
LiberationSans-Regular.ttf — 136 KB, 681 glyphs · WOFF2 · Keep all
liberation-sans-400.woff2 — 77.3 KB (−43%)
Converting alone keeps every glyph and feature; only the container and its compression change. The same font as WOFF is 88.6 KB.
LiberationSans-Regular.ttf · Subset: Latin
liberation-sans-400-latin.woff2 — 35.0 KB (−74%), 228 characters
The Latin range covers English and most Western European languages. Add Latin Extended for Polish, Czech, Turkish, Romanian and others.
Subset: Latin · folder fonts/ · font-display: swap
@font-face {
font-family: "Liberation Sans";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("fonts/liberation-sans-400-latin.woff2") format("woff2");
unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, …;
}The unicode-range lists exactly the characters the subset file contains.
Common uses
- Self-hosting a font on your own website instead of loading it from a font service.
- Shrinking a large font so a page loads faster, by keeping only the scripts your site is written in.
- Making WOFF2 files for a theme, an app or an e-book from the TTF or OTF a designer sent you.
- Unpacking a WOFF2 back to TTF or OTF to install and use it in desktop software, where the licence allows.
WOFF2, WOFF or TTF?
- WOFF2 (W3C Recommendation) compresses all tables together with Brotli and stores TrueType outlines in a more compact form. It is the format to serve on the web today.
- WOFF (W3C Recommendation) compresses each table with zlib. Only browsers that predate WOFF2, such as Internet Explorer 9–11, need it; list it after WOFF2 in
srcif you still support them. - TTF and OTF are the fonts themselves. Operating systems install them; serving them on a web page works but wastes bandwidth.
All three hold the same font: a WOFF or WOFF2 file unpacks to the same outlines, metrics and features as the font it was made from.
How the files are made
WOFF files are written with zlib per table. WOFF2 files follow the W3C format: the digital signature table (DSIG) is removed and the transform flag is set in the head table, as the specification requires; TrueType outlines get the glyf/loca transform; the optional hmtx transform is left out, because it saves at most a few per cent and some font libraries (fontkit, which PDFKit and pdf-lib use) read it wrong. Then all tables are compressed into one Brotli stream. The compressor is written for this site in JavaScript and runs in a background thread; where your browser can compress Brotli itself, the smaller of the two results is kept. Its files are typically 5–12% larger than those of Google’s reference encoder at its best setting. Subsetting uses hb-subset from HarfBuzz — the text-shaping library of Chrome, Firefox and Android — compiled to WebAssembly; it keeps every name record (the old Macintosh ones too), every OpenType feature and the variable-font data. Tables HarfBuzz cannot subset are left out of a subset: the old-style kern table (kerning in GPOS stays), Apple’s AAT layout tables, SVG colour glyphs and embedded EBDT bitmaps; the page warns when a font relies on one.
Subsets and unicode-range
A font often contains thousands of characters a site never shows. The ranges here are the ones Google Fonts and Fontsource use, so a subset matches what font services deliver. With One file per range, each range becomes its own file and its own @font-face rule with a unicode-range (CSS Fonts Module Level 4): a browser downloads a file only when the page uses one of its characters, so an English page never loads the Cyrillic file. Characters the font does not have are reported, and text in those characters falls back to the next font in your font-family stack.
Licences: may you convert this font?
Fonts under the SIL Open Font License may be self-hosted as web fonts (OFL-FAQ 2.1); keep the copyright and licence with the files (1.10) — the ZIP includes the details from each font. A plain conversion to WOFF or WOFF2 keeps the font data, so the font keeps its name (2.2.1). Subsetting or removing hinting makes a Modified Version: if the font declares a Reserved Font Name, the modified font must not use it (2.5–2.7), and this tool does not rename fonts, so keep all characters for such fonts unless the authors allow it. Commercial fonts are different: many licences (EULAs) forbid converting a desktop font to a web format or need a separate web licence. The tool shows each font’s licence fields and its embedding setting (OS/2 fsType) as a reminder, but only the licence you agreed to decides.
Limitations
- A TrueType or OpenType collection (.ttc, .otc) is converted font by font; a WOFF2 that holds a collection cannot be read.
- Embedded OpenType (.eot), PostScript Type 1 (.pfb) and old Mac suitcase fonts are not supported.
- The tool does not rename fonts or change their outlines, metrics or vertical alignment; it converts and subsets only.
- Up to 40 fonts at a time and 40 MB per file; very large CJK fonts take a while to compress on phones.
- Removing hinting changes how text looks only where TrueType hinting is used (mostly Windows at small sizes without high-resolution screens).
- A subset leaves out the tables HarfBuzz cannot subset: a font that kerns only with the old
kerntable loses its kerning, an OpenType-SVG colour font its SVG glyphs, and Apple AAT tables (morx, kerx) and embedded bitmaps are dropped. The page warns about each of them.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot. Only when you subset a font or remove its hinting: the HarfBuzz subsetting engine (about 600 KB) is downloaded once from this site. Your fonts are never uploaded.
Frequently asked questions
Are my fonts uploaded?
No. They are read, converted and checked in your browser, in a background thread. Only the subsetting engine is downloaded from this site the first time you subset; your files stay on your device.
Why is my WOFF2 a little larger than the one Google Fonts serves?
Google Fonts compresses with Google’s own encoder at its highest setting, and its files are often subset already. This tool’s Brotli encoder is a little less thorough; expect about 5–12% more for the same characters. Subsetting saves far more than that.
Can I convert WOFF2 back to TTF or OTF?
Yes. Add the WOFF2 (or WOFF) and tick TTF / OTF. Fonts with TrueType outlines become .ttf files and fonts with PostScript (CFF) outlines become .otf files. Only do it where the font’s licence allows desktop use.
What does “One file per range” do?
It writes a separate file for each ticked range (Latin, Latin Extended, Cyrillic …) and gives each @font-face rule a unicode-range. Browsers then download only the files with characters the page uses. Characters that appear in two ranges go into the first file only.
Which font-display value should I pick?
swap shows the text in a fallback font at once and switches when the web font arrives — the usual choice for body text. optional uses the font only if it arrives very quickly, which avoids layout shifts; block hides text briefly and suits icon fonts.
Does converting change how the font looks?
No. Converting keeps the outlines, spacing, kerning and OpenType features. Subsetting removes the characters you did not keep (and the glyphs only they use) and the few tables HarfBuzz cannot subset; the page warns when a font relies on one of them, and the browser check on the results page shows the converted font drawing text.