Generate
@font-face CSS Instantly
Build production-ready @font-face declarations for any custom web font. Set family name, weights, styles, file URLs, and font-display — get clean CSS in seconds.
Multi-Weight Support
Add as many font weight and style variants as you need — thin, regular, bold, italic — all in one click.
Auto Format Detection
Paste any font URL (.woff2, .woff, .ttf, .otf) and the correct format() hint is added automatically.
Copy-Ready Output
Get clean, properly indented @font-face CSS that you can paste directly into your stylesheet.
This becomes the value you use in font-family: 'MyFont' throughout your CSS.
Font Variants(1 variant)
One URL per line. Format (woff2, woff, ttf, otf) is detected automatically from the file extension.
@font-face {
font-family: 'MyFont';
font-weight: 400;
font-style: normal;
font-display: swap;
src: /* paste font URL here */;
}Tip: Paste this CSS at the top of your stylesheet (or in a @layer base block in Tailwind). Reference the font with font-family: 'MyFont', sans-serif;. Always include a generic family as a fallback.
Frequently Asked Questions
Everything you need to know about Font Face Generator.