Generate Production @font-face & Preload CSS

Drop your WOFF2, WOFF, TTF, or OTF font files to auto-detect weights, italics, and variable ranges and emit production @font-face CSS, crossorigin preload HTML, and Anti-CLS fallbacks.

drop .woff2 / .woff / .ttf / .otf · auto-detects weight & italic

.woff2 · .woff · .ttf · .otf

  • Auto weight/italic detection
  • Includes crossorigin preload
  • Optional Anti-CLS overrides
100% browser-localVerify 0 bytes sent in Network tab

Benchmark & Expected Output

@font-face + preload snippet

Before (Input)

WOFF2 / TTF / OTF · inter-regular.woff2 (51 KB)

After (Output)

CSS + HTML Preload · @font-face { font-display: swap } + <link rel="preload"> snippet

Source vs. target font specification comparison
PropertySource: WOFF2Target: CSS @font-face
File extension.woff2.css
CompressionBrotli (entropy + table transform)Text / optional gzip
Outline / CurveQuadratic or Cubic SFNTCSS / Data URI Text
Browser supportAll Modern Browsers (97%+)Universal (Web + OS)
OpenType GSUB/GPOSYesYes
Best forProduction web typography across all modern browsers, delivering 40%–60% smaller payloads than TTF/OTF and ~30% smaller files than WOFF 1.0.Loading self-hosted WOFF2 fonts with font-display: swap, unicode-range lazy slices, and zero-CLS size-adjust fallbacks.

How it works

How to use @font-face CSS Generator locally in your browser

Generate clean @font-face CSS with font-display, variable weight ranges, <link rel='preload'>, and Anti-CLS fallbacks.

  1. Drop font files

    Add one or multiple weights from your self-hosted font folder.

  2. Configure CSS options

    Set your font URL prefix (e.g. /fonts/), font-display, preload tags, and CLS fallback preset.

  3. Copy production CSS

    Paste the generated @font-face + preload tags straight into your app.

FAQ

Frequently asked questions

Why does the generated preload link include crossorigin?

Font preloads always use anonymous CORS mode in browsers; omitting crossorigin causes duplicate double-downloads.

Does it auto-detect font-weight for variable fonts?

Yes. When fvar wght is present, it outputs ranges like font-weight: 100 900 automatically.

Can I include Anti-CLS fallback rules inside the same stylesheet?

Yes — keep 'Include Anti-CLS fallback CSS' enabled to include metric overrides automatically.