# .otf MIME Type: font/otf

> OpenType desktop fonts. Convert to WOFF2 for the web.

- MIME type: `font/otf`
- Extensions: .otf
- Also seen as: `application/x-font-opentype`
- Content-Type header: `font/otf`
- Compress in transit: yes
- File signature: `4F 54 54 4F` (for CFF-based fonts; TrueType-flavoured OpenType starts 00 01 00 00)

## Good to know

- Uncompressed, so enable gzip or Brotli if you serve OTF files.

## Server configuration

### nginx (inside the types block in mime.types)

```
font/otf otf;
```

### Apache (.htaccess or server config)

```
AddType font/otf .otf
```

### Express

```
res.set("Content-Type", "font/otf");
```

### Python

```
import mimetypes

mimetypes.add_type("font/otf", ".otf")
```

### HTML file input

```
<input type="file" accept=".otf,font/otf">
```

## FAQ

### What is the MIME type for .otf files?

`font/otf`. You may also see `application/x-font-opentype`, but `font/otf` is the one to send.

### What Content-Type header should a .otf file be served with?

`Content-Type: font/otf`. It compresses well, so let the server apply gzip or Brotli.

### How can I tell if a file is really a .otf?

Check its bytes rather than the extension: OTF files start with `4F 54 54 4F` (`OTTO`) — for CFF-based fonts; TrueType-flavoured OpenType starts 00 01 00 00. On the command line, `file --mime-type name.otf` does this for you.

## Related types

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

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