Upload Font Files ยท Generate Cross-Browser @font-face CSS ยท Base64 Embedding
@font-face is a CSS rule that allows websites to use custom fonts hosted on a server, without relying on locally installed fonts. It enables unique brand typography and design across all devices. This generator helps you quickly create cross-browser @font-face CSS code from your font files.
Base64 embedding: font data is directly included in the CSS file โ no extra HTTP requests. Best for small fonts (<50KB). Pros: fewer requests. Cons: larger CSS file, can't be cached separately by the browser. External files: referenced via url(), ideal for larger fonts, independently cached. This tool supports both approaches.
Before using custom fonts, ensure you have proper licensing. Commercial fonts typically require a separate Web Font license. Free fonts (Google Fonts, Open Font Library) can be used freely. This tool only processes files you upload locally โ nothing is uploaded or recorded by us. Always check the license of any font before using it on a website.
WOFF2 (Web Open Font Format 2) is specifically designed for the web with Brotli compression, typically 30-50% smaller than TTF. All modern browsers support WOFF2. TTF/OTF are desktop font formats with broader compatibility but larger file sizes. Best practice: use WOFF2 as primary format with TTF as fallback for older browsers.
font-display:swap controls custom font loading behavior. With 'swap', the browser displays text using a system font immediately (FOUT โ Flash of Unstyled Text), then swaps to the custom font once it loads. This eliminates FOIT (Flash of Invisible Text) where users can't read content while fonts load. 'swap' is recommended for most websites and is our default setting.
๐ก All file processing is done locally in your browser. No data uploaded. Works offline.