{"id":94,"date":"2026-10-18T17:53:15","date_gmt":"2026-10-18T17:53:15","guid":{"rendered":"https:\/\/refracttools.com\/blog\/?p=94"},"modified":"2026-10-18T17:53:15","modified_gmt":"2026-10-18T17:53:15","slug":"convert-ttf-to-woff2","status":"publish","type":"post","link":"https:\/\/refracttools.com\/blog\/typography\/convert-ttf-to-woff2\/","title":{"rendered":"Convert TTF to WOFF2 and subset fonts for faster pages"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To make web fonts load faster, convert them from TTF or OTF to WOFF2 and subset them, removing every character your site doesn&#8217;t use. WOFF2 alone typically makes a font noticeably smaller than its TTF original, and subsetting a text font to Latin characters often takes it from 100\u2013300 KB down to 15\u201330 KB. Every browser in use today supports WOFF2, so it&#8217;s the only format most sites need.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains the formats, how subsetting works, the <code>@font-face<\/code> CSS to load the result, and the licensing check to do first.<\/p>\n\n\n\n<div class=\"wp-block-group is-style-refract-takeaways is-layout-constrained wp-block-group-is-layout-constrained\">\n<h3 class=\"wp-block-heading\">Key takeaways<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TTF and OTF are desktop formats. WOFF2 is the same font compressed for the web.<\/li>\n\n\n<li>In Google&#8217;s tests on the Google Fonts collection, WOFF2 files averaged 29% smaller than WOFF.<\/li>\n\n\n<li>Subsetting removes unused characters, which usually saves far more than the format change.<\/li>\n\n\n<li>Use <code>unicode-range<\/code> to split a font into language subsets that load only when needed.<\/li>\n\n\n<li>Check the font&#8217;s licence before converting or subsetting a commercial font.<\/li>\n<\/ul>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">TTF, OTF, WOFF and WOFF2<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><div class=\"table-scroll\" tabindex=\"0\" role=\"region\" aria-label=\"Scrollable table\"><table><thead><tr><th>Format<\/th><th>What it is<\/th><th>Use on the web?<\/th><\/tr><\/thead><tbody><tr><td>TTF \/ OTF<\/td><td>Desktop font files for design apps and operating systems<\/td><td>Only as a last resort<\/td><\/tr><tr><td>WOFF<\/td><td>A web wrapper with older zlib compression<\/td><td>No longer needed<\/td><\/tr><tr><td>WOFF2<\/td><td>The web format, with Brotli compression and font-specific tricks<\/td><td>Yes: the default<\/td><\/tr><\/tbody><\/table><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">WOFF2 grew out of Google&#8217;s font compression work and is a W3C standard. It packs the same outlines and features as the original font, so it looks identical, but uses Brotli compression plus pre-processing that suits font data. Unless you need to support very old browsers, you can drop WOFF and TTF from your <code>@font-face<\/code> rules entirely.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What subsetting removes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most fonts carry far more than an English-language site will ever show: Greek, Cyrillic and Vietnamese characters, maths symbols, rare punctuation, and alternate letter shapes. Subsetting keeps only the characters you choose.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Basic Latin<\/strong> covers English and the characters on a standard keyboard.<\/li>\n\n\n<li><strong>Latin-1 Supplement and Latin Extended<\/strong> add accented letters for French, German, Spanish, Polish and other European languages.<\/li>\n\n\n<li><strong>Extra symbols<\/strong> such as \u00a3, \u20ac, curly quotes, dashes and arrows are worth adding explicitly if your content uses them.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Smaller fonts appear sooner, which shortens the time text spends invisible or in a fallback font and reduces the layout shift when the web font swaps in.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Loading the converted font with @font-face<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>@font-face {\n  font-family: \"Inter\";\n  src: url(\"\/fonts\/inter-latin.woff2\") format(\"woff2\");\n  font-weight: 100 900; \/* a weight range for variable fonts *\/\n  font-style: normal;\n  font-display: swap;\n  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC;\n}\n\nbody {\n  font-family: \"Inter\", system-ui, sans-serif;\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>font-display: swap<\/code> shows a fallback font straight away and swaps in the web font when it arrives, so text is never invisible.<\/li>\n\n\n<li>For a variable font, give <code>font-weight<\/code> a range (here <code>100 900<\/code>) so one file serves every weight.<\/li>\n\n\n<li>Preload the one or two fonts used above the fold: <code>&lt;link rel=\"preload\" href=\"\/fonts\/inter-latin.woff2\" as=\"font\" type=\"font\/woff2\" crossorigin&gt;<\/code>. The <code>crossorigin<\/code> attribute is needed even for fonts on your own domain.<\/li>\n<\/ul>\n\n\n<aside class=\"tool-card tool-card--inline\"><span class=\"swatch\" style=\"background:linear-gradient(90deg,#13161c 0 40%,#5ce1c6 40%)\" aria-hidden=\"true\"><\/span><div class=\"tool-card__body\"><p class=\"tool-card__eyebrow\">Free tool<\/p><p class=\"tool-card__name\">Font converter &amp; subsetter<\/p><p class=\"tool-card__blurb\">TTF\/OTF to WOFF2, with subsetting that cuts fonts by up to 90%.<\/p><\/div><a class=\"btn primary\" href=\"https:\/\/refracttools.com\/font-converter\/\">Try it free <span aria-hidden=\"true\">\u2192<\/span><\/a><\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">Splitting fonts with unicode-range<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>unicode-range<\/code> tells the browser which characters a font file covers. Give several <code>@font-face<\/code> rules the same family name, each with its own file and range, and the browser downloads only the files whose characters appear on the page. That&#8217;s how large font services serve Latin readers one small file and Cyrillic readers another.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@font-face {\n  font-family: \"Inter\";\n  src: url(\"\/fonts\/inter-latin.woff2\") format(\"woff2\");\n  unicode-range: U+0000-00FF;\n}\n@font-face {\n  font-family: \"Inter\";\n  src: url(\"\/fonts\/inter-cyrillic.woff2\") format(\"woff2\");\n  unicode-range: U+0400-04FF;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Why self-host your fonts?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Converting and subsetting is most useful when you host fonts yourself rather than loading them from a font service. Self-hosting removes a connection to another domain, lets you control exactly which characters and weights ship, and keeps visitors&#8217; IP addresses off third-party servers. That last point matters in Europe: in 2022 a Munich court found that loading Google Fonts from Google&#8217;s servers without consent breached GDPR.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Licences: check before you convert<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Converting and subsetting change the font file, which some licences don&#8217;t allow. Open-source fonts under the SIL Open Font License, such as most Google Fonts, can be converted and subset freely. Many commercial licences only permit web use of files supplied by the foundry, or forbid modification. Read the licence, or ask the foundry, before converting a font you&#8217;ve bought.<\/p>\n\n\n\n<div class=\"wp-block-group is-style-refract-callout is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"wp-block-paragraph\"><strong>Tip:<\/strong> Hinting helps fonts render crisply at small sizes on older, low-resolution Windows screens. Most screens today are high-resolution, so removing hinting is usually safe and saves a lot of space. Keep it if many of your visitors use older Windows PCs.<\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Will subsetting break kerning or ligatures?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Not if it&#8217;s done properly. A good subsetter such as HarfBuzz keeps the layout features (kerning, ligatures, alternates) for every character you keep, along with any extra glyphs those features need. The catch is content you didn&#8217;t plan for: if editors later paste text with characters outside your subset, those characters fall back to another font. Type your own sample text into a preview before you ship, and include a little more than you think you need.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Convert and subset your fonts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/refracttools.com\/font-converter\/\">font converter and subsetter<\/a> converts TTF, OTF and WOFF files to WOFF2 using HarfBuzz and Google&#8217;s WOFF2 encoder, compiled to run in your browser, so your fonts are never uploaded. Tick the character sets you need, add any extra symbols, keep or fix variable axes, preview your own text, then download the fonts with matching <code>@font-face<\/code> CSS. To explore a variable font&#8217;s axes before you subset it, try the <a href=\"https:\/\/refracttools.com\/variable-font-playground\/\">variable font playground<\/a>, and see the <a href=\"https:\/\/refracttools.com\/blog\/typography\/fluid-typography-clamp\/\">fluid typography guide<\/a> for sizing the result.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Sources: <a href=\"https:\/\/w3.org\/TR\/WOFF2\/\" rel=\"noopener\" target=\"_blank\">W3C: WOFF File Format 2.0<\/a>, <a href=\"https:\/\/lwn.net\/Articles\/573348\/\" rel=\"noopener\" target=\"_blank\">LWN: WOFF2 compression results<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Convert TTF and OTF fonts to WOFF2 and subset them to the characters you use, often cutting a text font to 15\u201330 KB. Formats, @font-face, unicode-range and the licence check.<\/p>\n","protected":false},"author":1,"featured_media":93,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_refract_tool":"font-converter","footnotes":""},"categories":[10],"tags":[17,47,45],"class_list":["post-94","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typography","tag-performance","tag-typography","tag-web-fonts"],"_links":{"self":[{"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":1,"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":114,"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions\/114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/media\/93"}],"wp:attachment":[{"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/refracttools.com\/blog\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}