devkult_
tools29converters34

.ts MIME type

MPEG transport streamvideo

video/mp2t

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

MIME typevideo/mp2t
Extensions.ts
Content-Typevideo/mp2t
Compress in transit?No — already compressed
File signature47 (G)
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.

Serve .ts files with the right type

The response header to send:

Content-Type: video/mp2t

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

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

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.ts | grep -i '^content-type:'
file --mime-type file.ts

Frequently asked questions

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

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options