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?

The @font-face CSS at-rule allows web developers to specify custom fonts to display text on their websites. Instead of being limited to web-safe fonts installed on users' computers, you can use any font by providing the font files and telling the browser how to use them.

A properly configured @font-face rule includes the font family name, source files with format hints, and optional properties like font-weight, font-style, and font-display for optimal loading behavior.

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.

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 loadedMost 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