# .vtt MIME Type: text/vtt

> Captions and subtitles for HTML `<track>` elements.

- MIME type: `text/vtt`
- Extensions: .vtt
- Content-Type header: `text/vtt; charset=utf-8`
- Compress in transit: yes

## Good to know

- Browsers ignore a `<track>` file served with the wrong type.
- Cross-origin caption files need CORS headers and `crossorigin` on the `<video>` element.

## Server configuration

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

```
text/vtt vtt;
```

### Apache (.htaccess or server config)

```
AddType text/vtt .vtt
```

### Express

```
res.set("Content-Type", "text/vtt; charset=utf-8");
```

### Python

```
import mimetypes

mimetypes.add_type("text/vtt", ".vtt")
```

### HTML file input

```
<input type="file" accept=".vtt,text/vtt">
```

## FAQ

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

`text/vtt`.

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

`Content-Type: text/vtt; charset=utf-8`. As a text format, include the charset so browsers don't guess the encoding. It compresses well, so let the server apply gzip or Brotli.

## Related types

- [.mp4 — video/mp4](https://www.devkult.com/mime/mp4.md)
- [.webm — video/webm](https://www.devkult.com/mime/webm.md)

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