Font Converter

@font-face Generator

Generate production-ready @font-face CSS code for web fonts

Browser-OnlyBase64 SupportCustom URL Paths

Drop your font files here

or click to browse from your computer

Supports: WOFF2, WOFF, TTF, OTF, EOT, SVG

Output Options

Developer & Verifier

Marcus Rodriguez

Developed by

Marcus Rodriguez

Lead Developer

Sarah Mitchell

Verified by

Sarah Mitchell

Product Designer, Font Specialist

What is Webfont Generation?

A @font-face CSS kit is a collection of declarations that define custom fonts for websites, specifying file sources in WOFF2, WOFF, and TTF formats with optimized ordering so browsers download the smallest compatible file first. WOFF2 compresses 30–50% smaller than TTF using Brotli compression, making it the recommended primary format for all modern browsers.

The median Latin web font measures 12–19 KB in WOFF2 format (phpied.com analysis of 1,074 Google Fonts). WOFF2 has 96%+ browser support — safe as the primary format in any @font-face src list. Proper format ordering places WOFF2 first, then WOFF, then TTF, matching font loading best practices.

Base64 embedding eliminates HTTP requests but adds 33% to file size and reduces Gzip compression efficiency. The font-display property controls fallback behavior during page load — font-display: swap shows fallback text immediately, preventing the 3-second Flash of Invisible Text (FOIT) that occurs without it.

Upload font files in WOFF2, WOFF, TTF, OTF, EOT, or SVG format, then choose between URL-referenced or Base64-embedded output. For URL-based CSS, specify a custom font directory path (e.g., /fonts/ or ../assets/fonts/) to match your project structure. The generator produces complete @font-face rules with optimized format ordering and correct MIME types for each format.

How to Use This Generator

1

Upload Font Files

Drag and drop or click to upload fonts in TTF, OTF, WOFF, or WOFF2 formats.

2

Configure Settings

Specify font family name, weight, style, and font-display strategy for loading behavior.

3

Choose Output

Select URL-based references for hosted fonts or Base64 embedding for self-contained CSS.

4

Copy CSS

Copy the generated @font-face rules to use in your stylesheet or HTML.

Features

Multi-Format Output (WOFF2/WOFF/TTF)
Base64 Encoding Option
CSS @font-face Generation
Font-Display Configuration
Custom URL Paths
Browser-Based Processing
Batch Conversion
Size Optimization Stats

Web Font Format Comparison

FormatCompressionFile SizeBrowser SupportBest For
WOFF2BrotliSmallest (~30% less than WOFF)Chrome 36+ Firefox 39+ Safari 12+ Edge 14+Modern web (recommended)
WOFFzlibSmallChrome 5+ Firefox 3.6+ Safari 5.1+ Edge 12+Legacy browser fallback
TTF (TrueType)NoneLarge (uncompressed)Chrome 4+ Firefox 3.5+ Safari 3.1+ Edge 12+Universal compatibility
EOTNoneLargeIE 6-11 onlyLegacy IE (deprecated)
SVG FontNoneVery largeSafari (old iOS)Deprecated

Frequently Asked Questions

What is WOFF2 and why should I use it?
WOFF2 (Web Open Font Format 2) uses Brotli compression to achieve ~30% smaller file sizes than WOFF. It's supported by all modern browsers and is the recommended format for web fonts.
Which font formats do I need for full browser support?
For modern browsers (95%+ coverage), WOFF2 alone is sufficient. For legacy support, add WOFF as a fallback. TTF provides universal compatibility. EOT is only needed for IE8 and below (effectively obsolete).
What is font hinting?
Font hinting is instructions embedded in font files that optimize rendering at small sizes on low-resolution screens. TrueType hints improve clarity on Windows. Most modern screens (Retina/HiDPI) render well without hinting.
Should I subset my web fonts?
Yes, if you only need specific character sets. Subsetting removes unused glyphs and can reduce file size by 50-90%. Use our Font Subsetter tool or combine with unicode-range in your @font-face rules.
What is font-display in @font-face?
font-display controls how text appears while a web font loads. The swap value (recommended) shows fallback text immediately then swaps when loaded. This prevents invisible text (FOIT) and improves perceived performance.
How do I optimize web font loading?
Use WOFF2 format, subset to needed characters, set font-display: swap, preload critical fonts with <link rel="preload">, and use unicode-range to split large fonts. This tool generates optimized @font-face CSS with these best practices.

Related Tools & Guides