# .ts MIME Type: video/mp2t

> The registered type for .ts is MPEG-2 transport stream video — not TypeScript.

- MIME type: `video/mp2t`
- Extensions: .ts
- Content-Type header: `video/mp2t`
- Compress in transit: no (already compressed)
- File signature: `47` (a sync byte that repeats every 188 bytes)

## Good to know

- TypeScript source has no registered MIME type. Many servers map `.ts` to `video/mp2t`, which is why a browser may offer to download or play a `.ts` file.
- Browsers don't execute TypeScript; compile it to `.js` and serve that as `text/javascript`.
- HLS video segments (`segment0.ts`) are the main legitimate use of this type, alongside `.m3u8` playlists.

## Server configuration

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

```
video/mp2t ts;
```

### Apache (.htaccess or server config)

```
AddType video/mp2t .ts
```

### Express

```
res.set("Content-Type", "video/mp2t");
```

### Python

```
import mimetypes

mimetypes.add_type("video/mp2t", ".ts")
```

### HTML file input

```
<input type="file" accept=".ts,video/mp2t">
```

## FAQ

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

`video/mp2t`.

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

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

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

Check its bytes rather than the extension: TS files start with `47` (`G`) — a sync byte that repeats every 188 bytes. On the command line, `file --mime-type name.ts` does this for you.

## Related types

- [.m3u8 — application/vnd.apple.mpegurl](https://www.devkult.com/mime/m3u8.md)
- [.mp4 — video/mp4](https://www.devkult.com/mime/mp4.md)
- [.js — text/javascript](https://www.devkult.com/mime/js.md)

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