# .woff2 MIME Type: font/woff2

> The web font format to use today: Brotli-compressed, supported by every current browser.

- MIME type: `font/woff2`
- Extensions: .woff2
- Content-Type header: `font/woff2`
- Compress in transit: no (already compressed)
- File signature: `77 4F 46 32`

## Good to know

- Already compressed — don't gzip it again.
- Fonts loaded cross-origin need `Access-Control-Allow-Origin`; `@font-face` requests are CORS requests.
- Fingerprinted font files can be cached for a year with `Cache-Control: public, max-age=31536000, immutable`.

## Server configuration

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

```
font/woff2 woff2;
```

### Apache (.htaccess or server config)

```
AddType font/woff2 .woff2
```

### Express

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

### Python

```
import mimetypes

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

### HTML file input

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

## FAQ

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

`font/woff2`.

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

`Content-Type: font/woff2`. It's already compressed, so servers shouldn't gzip it.

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

Check its bytes rather than the extension: WOFF2 files start with `77 4F 46 32` (`wOF2`). On the command line, `file --mime-type name.woff2` does this for you.

## Related types

- [.woff — font/woff](https://www.devkult.com/mime/woff.md)
- [.ttf — font/ttf](https://www.devkult.com/mime/ttf.md)
- [.otf — font/otf](https://www.devkult.com/mime/otf.md)
- [.css — text/css](https://www.devkult.com/mime/css.md)

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