Web Font Loading Snippet Generator: @font-face, font-display and preload

Writes @font-face rules, preload tags and a font stack from a list of your font files.

Use the tool

Why this tool exists

Web fonts can block or shift text. Good loading code is short but easy to get wrong.

The tool orders WOFF2 first, adds format hints, sets font-display, and preloads the first faces you choose with crossorigin. It explains what the chosen font-display value does. It does not check licenses or subset the file; use the Font Subsetter for size.

How to use it

  1. Add one line per face: Family | weight | style | files.
  2. Pick font-display and how many faces to preload.
  3. Set the fallback fonts.
  4. Copy the CSS and head tags.

Frequently asked questions

Which font-display should I use?

swap shows text at once and swaps later; optional avoids layout shift but may keep the fallback. Avoid block for body text.

Do I need WOFF as well as WOFF2?

Only for very old browsers. WOFF2 is supported everywhere current.

Why preload only two faces?

Each preload competes for bandwidth. Preload faces used above the fold.

Does it upload fonts?

No, it only writes text.