Webfont Generator
This webfont generator turns the TTF, OTF or WOFF files of a typeface into a web font kit: WOFF2 files, optionally cut down to Latin characters, plus the @font-face rules with font-display: swap and a preload line. It runs Google's woff2 encoder and the HarfBuzz subsetter in your browser, so your fonts are never uploaded.
Drop font files here
TTF, OTF, WOFF or WOFF2, several at once if you like.
Fonts are converted only in your browser and never uploaded.
Results
@font-face code
Preload for the <head>
Only for the font needed first in the visible area, for example for the main heading.
From the Solo plan
Keep web fonts small with a budget
A new typeface or one more style is added quickly. A performance budget per URL in a plan sets a limit for font weight and emails you as soon as a page exceeds it.
Webfont generator output: WOFF2 files, @font-face rules and a preload line
Drop all styles of a family at once, for example Regular, Italic and Bold. Each file becomes a WOFF2 file with its own @font-face block; family name, weight and style come from the font's own name and OS/2 tables, so the blocks share one font-family and the browser picks the right file for font-weight: 700 or font-style: italic. The preload line is written for the first file only, because only the font needed first in the visible area should be preloaded.
WOFF2 is the only format the rule needs: all current versions of Chrome, Edge, Firefox and Safari support it (caniuse.com/woff2). TTF, OTF or WOFF fallbacks only matter for Internet Explorer.
Webfont kit measured: two Roboto styles drop from 318 KB to 41 KB
Measured with this tool on 27.11.2026: Roboto Regular and Bold (version 2.001, Apache 2.0) are 325,340 bytes together as TTF. As WOFF2 they are 123,364 bytes, with the Latin subset 42,444 bytes, 87 percent less than the TTF files.
A variable font can replace several static styles with one file. Inter Variable (OFL) covers all weights from 100 to 900; with the Latin subset it is 105,804 bytes as WOFF2. Whether one variable file or two or three static files is smaller depends on how many styles the pages really use.
Webfont subsetting with HarfBuzz: fewer glyphs, all OpenType features kept
The subset option uses hb-subset from HarfBuzz, the text shaping library in Chrome, Firefox and Android. It removes all glyphs outside the chosen range and keeps kerning, ligatures, hinting, OpenType features such as tabular figures and stylistic sets, and the axes of variable fonts. The ranges are the same as the "latin" and "latin-ext" subsets of the Google Fonts CSS API.
Latin covers English and Western European languages; Polish, Czech, Hungarian, Romanian and Turkish need Latin Extended. If a page uses a character outside the subset, the browser draws it in the next font of the font-family stack, so check pages in every language you serve.
Webfont loading: font-display swap, unicode-range and preload
font-display: swap shows text immediately in a fallback font and swaps in the web font once it has loaded, so text never stays invisible; the guide on font-display swap explains the trade-off with layout shifts. With a subset the rule also gets the matching unicode-range, so the browser only downloads the file if the page uses one of those characters.
Preload the font only if it renders text above the fold, for example the heading that is the largest contentful paint element. crossorigin is required on font preloads even on your own domain, because browsers always fetch fonts in CORS mode. Fonts from another domain need a preconnect instead; self-hosting the generated files avoids that connection.
Webfont licenses: check web use and subsetting rights first
Generating a web font changes the file. Fonts under the SIL Open Font License or Apache 2.0 allow that; commercial licenses often separate desktop and web use or forbid modified files. The generator shows a note if a font marks itself as "Restricted License" or forbids subsetting in its OS/2 table. The license of the font decides, not this note.
Other conversions
Webfont generator FAQ: upload, formats and quality
Are my fonts uploaded?
No. Conversion and subsetting run in web workers in your browser. The font files are never sent to a server.
Which files can the webfont generator read?
TTF, OTF with CFF outlines, WOFF and WOFF2, each up to 30 MB. Font collections (.ttc), EOT and SVG fonts are not supported.
Does the web font look different from the desktop font?
No. WOFF2 keeps outlines, hinting and OpenType features; only the storage is compressed. A subset removes characters outside the chosen range and leaves the others unchanged.
I only need one conversion. Which page fits?
The generator handles all directions. For a single format there are dedicated pages: TTF to WOFF2, OTF to WOFF2 and WOFF2 to TTF, linked under "Other conversions".
More free tools
- Minify JS: Minifies JavaScript with terser in your browser: shorter names, no dead code, optional source map, size before and after with gzip.
- Minify HTML: Removes whitespace, comments and redundant attributes from HTML and minifies inline CSS and JavaScript, right in your browser.
- Minify CSS: Minifies stylesheets with csso in your browser: shorter values, merged rules, license comments kept on request.
- Website Speed Test: Tests several pages of a site on mobile and desktop and shows real-user data, lab findings and competitors in one report.
- Image Compressor: Compresses and converts JPG, PNG, WebP and AVIF in bulk, with responsive sizes and srcset code. Images never leave your device.
- Redirect Checker: Follows a URL hop by hop with status code and milliseconds, and checks that http, https, www and non-www end up at one address.
Third-party licenses
Conversion uses wawoff2 with Google's woff2 and Brotli (MIT) and HarfBuzz hb-subset from harfbuzzjs (MIT, Old MIT). Full license texts: THIRD_PARTY_LICENSES.txt
A free account saves your tests and shows how your values change from one test to the next. Website performance monitoring with field data and alerts starts with the Solo plan.