Font Converter

Free @font-face CSS Generator for Custom Web Fonts

Upload your font files and generate @font-face CSS rules instantly

No SignupBrowser-Only100% Free

Drop your font files here

or click to browse from your computer

Supports: WOFF2, WOFF, TTF, OTF, EOT, SVG

Developer & Verifier

Marcus Rodriguez

Developed by

Marcus Rodriguez

Lead Developer

Sarah Mitchell

Verified by

Sarah Mitchell

Product Designer, Font Specialist

What is @font-face CSS?

A @font-face CSS declaration is a rule that defines a custom font family, specifies file sources in priority order, and controls loading behavior through the font-display property. 88% of websites use custom web fonts (HTTP Archive 2025), making @font-face the foundation of modern web typography. See our guide to @font-face optimization techniques to get the most from your declarations.

WOFF2 handles 65% of all font file requests with 96%+ browser support (HTTP Archive 2025). Correct format ordering in the src descriptor lists WOFF2 first, then WOFF, then TTF; browsers select the first supported format and skip the rest.

The font-display: swap property prevents Flash of Invisible Text (FOIT). Without it, Chrome and Firefox hide text for 3 seconds while waiting for the font to load. Font loading strategies and CSS implementation determine whether fonts block rendering or display fallback text immediately.

This generator accepts multiple font files (WOFF2, WOFF, TTF, OTF, EOT, and SVG) via drag-and-drop upload. Each font receives individual controls for family name, weight (100–900), style (normal, italic, oblique), and font-display value. The output is production-ready @font-face CSS with correct format hints and source ordering, available as clipboard copy or downloadable .css file. EOT declarations include the IE9-compatible query string syntax for legacy support.

How to Use This Generator

1

Upload Your Fonts

Drag and drop or click to upload your font files. Supports WOFF2, WOFF, TTF, OTF, EOT, and SVG formats. Follow our CSS implementation guide for best practices once your fonts are uploaded.

2

Customize Settings

Set the font family name, weight (100-900), style (normal/italic), and display property for each font.

3

Preview CSS Code

See the generated @font-face CSS rules in real-time as you adjust settings for your fonts.

4

Copy or Download

Copy the CSS to your clipboard or download as a fonts.css file ready to use in your project.

Features

100% Browser-Based Processing
No File Size Limits
Batch Font Support
Customizable font-weight (100-900)
Font-style Options (normal/italic/oblique)
Font-display Settings (swap/block/fallback/optional)
Copy to Clipboard
Download as CSS File

Understanding font-display Values

ValueBehaviorBest For
swapShows fallback immediately, swaps when loaded. See FOUT and FOIT solutions for context.Most websites (recommended)
blockHides text briefly (~3s), then shows font or fallbackIcon fonts, critical branding
fallbackShort block (~100ms), swaps within ~3s or uses fallbackBalance between speed and consistency
optionalVery short block, only swaps if immediately availablePerformance-critical pages
autoBrowser default (usually similar to block)Legacy behavior

Frequently Asked Questions

What is @font-face?
@font-face is a CSS at-rule that allows you to define custom fonts for use on your website. It specifies the font file location, format, and properties like font-weight and font-style.
How do I use the generated CSS?
Copy the generated CSS code and paste it into your stylesheet, or download the CSS file and link it in your HTML. Make sure your font files are accessible at the paths specified in the CSS.
What font formats are supported?
This tool supports WOFF2, WOFF, TTF, OTF, EOT, and SVG font formats. WOFF2 is recommended for modern browsers due to its superior compression.
Is my font file uploaded to a server?
No. This tool processes everything in your browser using JavaScript. Your font files never leave your device, ensuring complete privacy and security.
What is font-display and which should I use?
font-display controls how fonts are displayed while loading. 'swap' (recommended) shows fallback text immediately then swaps when loaded. 'block' hides text briefly. 'fallback' and 'optional' offer progressive enhancement.
Can I generate CSS for multiple fonts at once?
Yes! You can upload multiple font files at once. Each font gets its own @font-face rule with customizable settings for family name, weight, style, and display.
What's the difference between font-weight values?
Font-weight ranges from 100 (thin) to 900 (black). Common values: 400 is normal/regular, 700 is bold. Use the weight that matches your font file (e.g., a Bold variant should use 700).

Related Tools & Guides