Generate an @font-face rule
A self-hosted font needs three things: a WOFF2 file, a rule that points at it, and a fallback that stops the page jumping when it loads. This writes all three from the font itself.
- Free, unlimited
- 100% on-device
- No sign-up
Generate an @font-face rule
Drop your font files here
Or choose files from your device
TTF, OTF, WOFF, WOFF2, TTC or OTC in · up to 20 files · max 40 MB each
Every file is parsed and converted in this tab. Nothing is uploaded.
No font added yet.
Output
Font details
Three steps — nothing to install
Drop the font
TTF or OTF. The generator reads the real family name, the weight class and whether the face is italic.
Convert with CSS
The page opens in @font-face mode: you get a .woff2 download plus the CSS that references it.
Paste it in
Put the file in /fonts/, paste the rule into your stylesheet and the preload tag into the head of the page that uses it.
Why self-host instead of loading from a font CDN
A hosted font service sees the request, the referrer, the visitor's IP and the page they are on. That is a third-party request on every page view, and in the EU it has been treated as a transfer of personal data. Self-hosting removes the request entirely: the font comes from your own domain, under your own privacy policy.
It is also faster. One origin means no extra DNS lookup and no second TLS handshake, and you control the cache headers.
Why the fallback stack matters
A web font arrives after the first paint, so text either waits (invisible) or renders in the fallback and then swaps. Both cause a shift unless the fallback is metrically close. Listing system-ui and a generic family, then tuning with size-adjust if needed, keeps the layout still.
The generated CSS uses font-display: swap and a system-font fallback; if your layout still jumps, measure the two fonts and add size-adjust to the fallback rule.