Home › Developer Tools › TTF to WOFF2 Converter

TTF to WOFF2 Converter

Turn TrueType (.ttf) and OpenType (.otf) fonts into compact WOFF2 or WOFF web fonts and get the @font-face CSS to use them. Conversion runs entirely in your browser, so your font files never leave your device.

Last updated:

Drop TTF or OTF fonts here or click to choose Batch conversion · fonts are converted on your device and never uploaded
Advertisement
Advertisement

How to use the TTF to WOFF2 Converter

  1. Drop your .ttf or .otf files onto the box or click it to choose them. Conversion starts automatically.
  2. Pick the output: WOFF2 for modern browsers, WOFF2 + WOFF for the widest support, or WOFF only.
  3. Check the result: each font shows the new size, the percentage saved and whether the browser loaded it.
  4. Set the CSS options – the folder where you will upload the fonts, font-display and optional Base64 embedding.
  5. Press Download per file or Download all (ZIP), then copy the @font-face CSS into your stylesheet.

TTF vs WOFF vs WOFF2

TTF / OTFWOFFWOFF2
CompressionNonezlib (deflate) per tableBrotli + glyph table transforms
Typical size of a 300 KB TTF300 KBabout 140–170 KBabout 100–130 KB
Browser supportAll, but not recommended for the webAll, including IE 9+All current browsers
CSS format() hinttruetype / opentypewoffwoff2
MIME typefont/ttf, font/otffont/wofffont/woff2

Savings are calculated as (original size − new size) ÷ original size × 100. Example: a 741.9 KB TTF that becomes 330 KB as WOFF2 saves (741.9 − 330) ÷ 741.9 × 100 ≈ 55.5%.

How a WOFF file is built

The built-in encoder follows the W3C WOFF 1.0 specification:

  1. A 44-byte header starting with the signature wOFF, the original flavor (0x00010000 for TrueType or OTTO for CFF), the total file length, the number of tables and the size the uncompressed font will have.
  2. A table directory with one 20-byte entry per table, sorted by tag: tag, offset, compressed length, original length and the table's checksum.
  3. The table data, each table compressed with zlib when that makes it smaller (otherwise stored as is), padded to a 4-byte boundary.

Because every table is kept byte for byte, the browser recreates exactly the original font when it decompresses the file.

Using the generated @font-face CSS

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
body { font-family: "Inter", system-ui, sans-serif; }
  • Upload the converted files to the folder given in "Font URL folder" (for example /fonts/).
  • Add one @font-face rule per weight and style, all with the same font-family name, so font-weight: 700 picks the Bold file.
  • font-display: swap shows fallback text immediately and swaps in the web font when it arrives, which avoids invisible text.
  • Preload the most important font with <link rel="preload" href="/fonts/Inter-Regular.woff2" as="font" type="font/woff2" crossorigin>.
  • Serve fonts from the same domain or send an Access-Control-Allow-Origin header; browsers block cross-origin fonts without CORS.

Frequently asked questions

Why convert TTF to WOFF2?

WOFF2 is a compressed font format made for the web. It uses Brotli compression and font-specific transforms, so a WOFF2 file is typically 30–50% smaller than the original TTF, which makes pages load faster. Every current browser supports it.

Are my fonts uploaded to a server?

No. The WOFF2 encoder runs as WebAssembly inside your browser and the WOFF encoder uses the browser's built-in compression. Your font files never leave your device.

What happens if the WOFF2 encoder cannot load?

The encoder is downloaded from a public CDN the first time you convert. If you are offline or the CDN is blocked, the tool tells you and creates WOFF files with its built-in encoder instead. WOFF also works in all browsers; it is just a little larger than WOFF2.

Do I still need WOFF files?

For almost all sites, no. WOFF2 is supported by Chrome, Edge, Firefox, Safari (since version 12 on macOS and 10 on iOS) and Samsung Internet. Choose WOFF2 + WOFF only if you must support very old browsers such as Internet Explorer 11.

Is it legal to convert a font to WOFF2?

It depends on the font's license. Open-source fonts under the SIL Open Font License or Apache License may be converted and self-hosted. Many commercial desktop licenses do not include web embedding, so check the license (the Font Viewer tool shows it) before publishing.

Does conversion change how the font looks?

No. WOFF and WOFF2 are lossless containers: glyph outlines, kerning, OpenType features and hinting are preserved, and the browser decompresses the file back to the original font data.

Should I embed the font as Base64?

Usually not. Base64 makes the data about 33% larger and stops the browser from caching the font separately from the CSS. It can make sense for a small icon font or a single-file HTML document.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

CSS MinifierMinify CSS with csso or a built-in engine and see the size saved instantly.CSS FormatterBeautify CSS with indent controls and optional property sorting.Base64 Encoder DecoderEncode or decode Base64 text and files, and make data URIs.File Info ViewerCheck file size, type, date and MD5/SHA hashes.CSS @font-face GeneratorTurn font files or URLs into ready-to-paste @font-face rules with weights, styles and a preview.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.CSV to Markdown TableConvert CSV to a neatly aligned GitHub Markdown table with column alignment and live preview.CSV TransposeSwap rows and columns of CSV, TSV or pasted spreadsheet data, with delimiter auto-detect.Date Format ConverterConvert any date to ISO 8601, RFC 2822, Unix time and custom strftime, moment or Java patterns.ENV to JSON ConverterConvert .env files to JSON or YAML and JSON back to .env, with quotes and multiline values.File to Base64Convert any file to a Base64 string or data URI with MIME detection, line wrap and download.HTML Table to CSVExtract any table from HTML or page source to CSV, TSV or JSON, with colspan and rowspan handled.IEEE 754 Floating Point ConverterConvert decimals to 32/64-bit IEEE 754 floats: toggle bits, see hex, exact value and rounding error.INI to JSON ConverterConvert INI and CFG files to JSON and JSON back to INI, with sections, arrays and types.IP Address ConverterConvert IPv4 to decimal, hex, binary, octal and back, with class and private/public check.ISBN Converter & ValidatorConvert ISBN-10 to ISBN-13 and back, validate check digits and hyphenate, one or in bulk.JSON Flatten / UnflattenFlatten nested JSON to dot or bracket path keys, or unflatten flat keys back to nested JSON.JSON to Dart ClassTurn JSON into Dart model classes with fromJson, toJson, null safety and nested classes.JSON to Java ClassTurn JSON into Java POJOs or records with Lombok, getters/setters and Jackson or Gson annotations.JSON to Kotlin Data ClassTurn JSON into Kotlin data classes for kotlinx.serialization, Gson, Moshi or Jackson.JSON to Markdown TableTurn a JSON array of objects into a GitHub Markdown table with column picker and alignment.JSON to PHP ArrayConvert JSON to PHP array code (short [] or array()) and PHP arrays back to JSON.JSON to Rust StructTurn JSON into Rust structs with serde derives, rename attributes, Option and Vec types.JSON to SQL ConverterConvert a JSON array of objects to CREATE TABLE and INSERT statements for MySQL, Postgres, SQLite.JSON to Swift StructTurn JSON into Swift Codable structs with CodingKeys, optionals and nested types.JSON to TOML ConverterConvert JSON to clean TOML with tables, arrays of tables, inline tables and dates.JSONL to JSON ConverterConvert JSON Lines / NDJSON to a JSON array and back, with line-level error reports.Properties to YAML ConverterConvert Java .properties to nested YAML (application.yml) and YAML back to properties.PX to EM ConverterConvert pixels to em using the parent font size, and em back to px, with conversion tables.Query String to JSONConvert URL query strings to JSON with nested brackets and arrays, and JSON back to a query string.REM to PX ConverterConvert CSS rem values to pixels for any root font size, with a quick 0.25–6rem table.SQL to JSON ConverterConvert SQL INSERT statements and dumps into a JSON array of row objects, with CSV export.TSV to CSV ConverterConvert TSV to CSV and back, or between tab, comma, semicolon and pipe, with correct quoting.TypeScript to JavaScriptConvert TypeScript or TSX to clean JavaScript instantly: strip types, keep or compile JSX.XML to YAML ConverterConvert XML to clean YAML with attributes, text nodes, lists and exact error lines.YAML to XML ConverterConvert YAML to pretty, well-formed XML with custom root, attributes and array item tags.
See all 129 Data & File Format Converters →