Convert WOFF to WOFF2

Converting WOFF to WOFF2 re-wraps the same font tables with Brotli instead of zlib, which typically takes about thirty per cent off the file without touching a single outline. It is the cheapest improvement available to a site still serving a font kit assembled before WOFF2 existed, and it is worth doing alongside a look at the @font-face rule around it.

  • Where it runs On our server, because a browser cannot run the software this needs.
  • Lossless Nothing is discarded. The WOFF2 holds exactly what the WOFF held.
  • File size limit Up to 25 MB per file, free, without an account.
  • Worth knowing The outlines decide what an unwrapped font is: a WOFF holding PostScript curves becomes an OTF, one holding TrueType curves becomes a TTF. Asking for the other is refused rather than answered with a mislabelled file.

Up to 100 files at once. Mixed formats are fine.

The folder a WOFF usually arrives in

A file with this extension rarely turns up alone. It sits in a `fonts` directory beside an `.eot`, an `.svg`, a `.ttf` and sometimes a second `.woff` for the italic, with a stylesheet nearby containing a five-entry `src` list and a comment about Internet Explorer. That folder was generated by a web font tool at a point when serving four containers was the only way to reach every browser.

None of that is true any more, and the useful frame for this conversion is not "make this file smaller" but "reduce this folder to one file per weight". The rewrap is the easy part. The parts worth spending five minutes on are the rule around it, the character set the kit was built with, and whether you are licensed to be doing any of this — each of which has a section below.

What WOFF2 does to the file that WOFF does not

Both containers hold the same sfnt tables that a TTF or an OTF holds: the glyph outlines, the character map, the horizontal metrics, the kerning and the OpenType feature definitions. WOFF wraps them and deflates each with zlib. WOFF2 first transforms the tables into a representation designed to compress well — the glyph and loca tables in particular are restructured — and then applies Brotli to the result.

Two compressors and one extra preprocessing pass is where the difference comes from, and for an ordinary text face it lands at roughly thirty per cent. The typeface is untouched: identical outlines, identical spacing, identical features. A page that swaps one for the other renders the same and downloads less, which is as clean a change as web performance work ever offers.

The WOFF is as good a source as the TTF sitting beside it

It is tempting to reach for the desktop original on principle, and here it makes no difference. WOFF is a lossless container, so unwrapping it recovers exactly the tables that went in, and re-wrapping those as WOFF2 produces the same result you would get from the TTF in the same folder. There is no generational loss of the kind image formats suffer and no setting that can be got wrong.

That is worth stating because the advice is the opposite for other conversions in this family. Going from a WOFF to an installable TTF or OTF, provenance matters a great deal — the web copy is usually subset and renamed, and the desktop original is a materially better file. Going to WOFF2 you are staying inside the same character set either way, so use whichever file you have.

The @font-face stack a WOFF kit gave you can lose most of its entries

A generated rule from that era lists five sources: EOT with a query-string hack, WOFF2 if it was generated at all, WOFF, TTF, and SVG with a fragment identifier. Two of those are for browsers nobody supports. The EOT entry exists for Internet Explorer 8 and the SVG entry for a version of Safari on iOS that predates the format everything now uses.

The registry records WOFF2 as reaching every current browser, which is what makes the reduction safe: one `src: url("brand.woff2") format("woff2")` line is the modern rule. Look at your own analytics before deleting the WOFF entry rather than after, because "every current browser" and "every browser that visits this particular site" are not the same statement — a corporate intranet is the case that breaks it. Everything below the WOFF can go without checking anything.

Check the licence before re-wrapping a WOFF you inherited

This is the part of the page nobody comes for and it is the part most likely to matter. Commercial web font licences routinely forbid modifying, converting or re-encoding the files supplied, and a conversion is exactly that even when nothing about the typeface changes. Some foundries supply WOFF2 themselves and expect you to ask for it rather than make it.

A font that came with an inherited project has a licence somewhere — in the purchase records, the brand handover, the repository history, or a text file the generator dropped into the same folder. Find it first. If the font came out of a downloaded template, treat it as unlicensed until proven otherwise: a template author’s right to include a font says nothing about yours to serve it. Open licences are the easy case; the SIL Open Font License permits conversion, subsetting and redistribution provided the font is not sold on its own and reserved names are not reused.

A WOFF built years ago is subset to a smaller alphabet than you need

Almost all of the weight saving in a web font comes from removing glyphs, so kits were routinely cut down to basic Latin and a handful of punctuation. That was reasonable then and it is where the gaps in a modern page come from: a euro sign, a proper em dash, curly quotation marks, an ellipsis, or a name containing ł, ğ or ș.

Re-wrapping restores none of it. If the site shows a blank box or an obviously mismatched fallback glyph in a heading, the character was never in the file, and the fix is to re-cut from the desktop original with a subset that covers what the site actually sets. That is a different job from this one, and it is the job worth doing if the kit is more than a few years old.

Six WOFF files where one variable font might do

A kit of that vintage has one file per weight and style: regular, italic, medium, semibold, bold, bold italic. Six downloads, six `@font-face` blocks, and a fixed set of weights that a designer will eventually want to sit between.

If the typeface has since been released as a variable font, one WOFF2 can replace the lot with a continuous weight axis, and the total is usually smaller than the static set it replaces. That is a decision about the typeface rather than about the container, and it belongs in the same session as this conversion because it changes what you convert. Check whether the foundry ships a variable cut before you spend an afternoon re-wrapping six static files you are about to delete.

The internal name inside an inherited WOFF is not the name in your CSS

Every font carries a name table, and kit generators freely rewrote it — a file whose typeface is called something quite specific is frequently named `brandsans-webfont` inside. Because the `@font-face` rule declares whatever family name you like, the mismatch usually goes unnoticed for years.

It stops being harmless in two situations: when the internal name collides with a font installed on the visitor’s machine, and when two files prepared at different times both claim one family name and the browser has to pick. If type is switching unpredictably between weights on some machines and not others, opening the fonts and reading their internal names is the fastest route to the cause. The conversion carries the name through unchanged, so whatever the WOFF said, the WOFF2 says.

Serving the WOFF2 once it exists

Three things are worth setting at the same time as the file changes, because they are the rest of the download cost. A long cache lifetime with a hashed filename, since a font never changes in place. A `preload` link for the one or two faces above the fold, which removes the round trip spent discovering the font after the stylesheet parses. And `unicode-range` if you have separate subsets, so a page that sets no Cyrillic never fetches the Cyrillic file.

Fonts are also one of the few asset types where compression at the server is counterproductive: WOFF2 is already Brotli-compressed internally, and gzipping it again adds work for no saving. Most servers exclude font MIME types by default; if yours does not, excluding them is a one-line change.

Where a WOFF is converted, and the limits on it

This conversion runs on our server rather than in your browser, because fontTools has no browser build. The file travels over an encrypted connection, is converted in an isolated environment, and the working directory is deleted when the job finishes. That is a genuine difference from most conversions here and it is stated plainly rather than buried.

The free tier allows 25 MB per file, which is far more than any web font, and a batch comes back as a single ZIP. A batch is usually what this job actually is — the kit has six files in it and the rule is being rewritten once, so converting them one at a time is a waste of an afternoon.

How to convert a WOFF file into a WOFF2

  1. Confirm the licence permits conversion, then drop the WOFF files here — the whole folder at once.
  2. Choose WOFF2 as the target and start the conversion.
  3. Replace the @font-face src stack with a single WOFF2 entry and delete the old files.

WOFF against WOFF2: zlib and Brotli around the same tables

WOFF compared with WOFF2
WOFFWOFF2
Full nameWeb Open Font FormatWeb Open Font Format 2
File extension.woff.woff2
Media typefont/wofffont/woff2
First published20092018
Published byW3CW3C
SpecificationWOFF 1.0WOFF 2.0
LicensingOpen standardOpen standard
Standing todayLegacy, still read everywhereCurrent
Opens in a browserEvery browserEvery browser
Considered insteadTTFTTF

What survives

Nothing is discarded. WOFF and WOFF2 both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

Opening the result

WOFF dates from 2009 and is largely superseded. WOFF2 is what current software writes, so the conversion is as much about staying readable as about the file itself.

FontForge and fonttools read both WOFF and WOFF2, so there is a way to check the result against the original without a second tool.

What each format is for

WOFF is W3C's format, published in 2009. The specification is WOFF 1.0, and it is worth reading if the file has to outlive the tool that wrote it.

WOFF2 comes from W3C and dates from 2018, specified as WOFF 2.0. fonttools and FontForge all read it.

WOFF to WOFF2: size, fallbacks and licensing

Are my WOFF files uploaded anywhere?

Yes — this conversion needs software that cannot run in a browser, so the file is uploaded over an encrypted connection. It is deleted as soon as the job finishes, and the result is sent straight back to you without being stored. The work is done by fontTools, the font manipulation library used to build web fonts.

How much smaller is the WOFF2?

Around thirty per cent for a typical text face. WOFF2 preprocesses the font tables into a form that compresses better and then applies Brotli, where WOFF applies zlib to the tables as they stand. The saving is real and it is the only thing that changes.

Is anything lost in the rewrap?

No. Both containers are lossless wrappers around the same sfnt tables, so the outlines, metrics, kerning and OpenType features are byte-identical in effect. Only the compression differs.

Do I still need the WOFF as a fallback?

Every current browser reads WOFF2 and has done for years, so a fallback entry serves browsers that are not in your analytics. Check the numbers before you delete anything, then delete it — an unused src entry costs a request only when it is reached, and a stale one costs confusion forever.

Should I convert the WOFF or the TTF in the same folder?

Either. WOFF is a lossless container, so unwrapping it gives back exactly the tables the TTF holds and the resulting WOFF2 is the same. Unlike converting to a desktop format, provenance makes no difference here.

Am I allowed to convert a web font I inherited?

That depends on its licence, and many commercial web font licences explicitly forbid modifying or converting the files supplied. Find the licence before converting a font that came with a project. Open licences such as the SIL Open Font License permit conversion outright.

Why is my converted font still missing characters?

Because they were never in the file. A kit built years ago was almost certainly subset to a small character set, and a container conversion cannot add glyphs. The full set exists only in the original desktop font.

More about these formats