# .ttf MIME Type: font/ttf

> TrueType 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 header: `font/ttf`
- Compress in transit: yes
- File signature: `00 01 00 00`

## Good to know

- The `font/` top-level type was registered by RFC 8081 in 2017; older configs use `application/x-font-ttf`.
- Uncompressed, so enable gzip or Brotli if you serve TTF files.

## Server configuration

### 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">
```

## FAQ

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

- [.otf — font/otf](https://www.devkult.com/mime/otf.md)
- [.woff2 — font/woff2](https://www.devkult.com/mime/woff2.md)

Open the interactive page: https://www.devkult.com/mime/ttf