.ttf MIME type
TrueType fontfonts
font/ttfTrueType desktop fonts. Usable on the web, but WOFF2 is much smaller.
| MIME type | font/ttf |
|---|---|
| Extensions | .ttf |
| Also seen as | application/x-font-ttf, application/font-sfnt |
| Content-Type | font/ttf |
| Compress in transit? | Yes — enable gzip or Brotli |
| File signature | 00 01 00 00 |
Good to know
- The
font/top-level type was registered by RFC 8081 in 2017; older configs useapplication/x-font-ttf. - Uncompressed, so enable gzip or Brotli if you serve TTF files.
Serve .ttf files with the right type
The response header to send:
Content-Type: font/ttf
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
nginx (inside the types block in mime.types)
font/ttf ttf;
Apache (.htaccess or server config)
AddType font/ttf .ttf
Express
res.set("Content-Type", "font/ttf");Python
import mimetypes
mimetypes.add_type("font/ttf", ".ttf")HTML file input
<input type="file" accept=".ttf,font/ttf">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.ttf | grep -i '^content-type:' file --mime-type file.ttf
Frequently asked questions
What is the MIME type for .ttf files?
font/ttf. You may also see application/x-font-ttf, application/font-sfnt, but font/ttf is the one to send.
What Content-Type header should a .ttf file be served with?
Content-Type: font/ttf. It compresses well, so let the server apply gzip or Brotli.
How can I tell if a file is really a .ttf?
Check its bytes rather than the extension: TTF files start with 00 01 00 00. On the command line, file --mime-type name.ttf does this for you.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options