What Is a .TS File? (.ts, .mts, .m2ts, .tsx)

A .ts file is one of two unrelated things: an MPEG transport stream video, used for broadcast TV recordings, streaming segments and camcorders, or a TypeScript source code file used by web developers. You can tell them apart by size and content: video files are large binary data, TypeScript files are small readable text.

Extension
.ts, .mts, .m2ts, .tsx
Full name
MPEG Transport Stream video or TypeScript source code
Type
Video file
MIME type
video/mp2t

About TS files

As video, .ts means MPEG-2 Transport Stream, a format from the MPEG-2 standard designed for broadcasting over unreliable links. The data is split into fixed 188-byte packets, so a receiver can start playing mid-stream and survive dropouts. It carries MPEG-2, H.264 or HEVC video with MP2, AAC or AC-3 audio. TV tuner and set-top box recordings, HLS streaming segments and AVCHD camcorders (as .mts and .m2ts) all use it.

As code, .ts is TypeScript, Microsoft's typed superset of JavaScript. A TypeScript file is plain text containing code such as import statements, interfaces and type annotations, and is compiled to JavaScript before it runs in a browser or Node.js. The .tsx variant contains TypeScript with JSX, used in React projects. Opening one in a video player does nothing useful; open it in a code editor instead.

To tell which one you have, check the size and the neighbours. Video .ts files are usually tens of megabytes to gigabytes and sit in recording or download folders; TypeScript files are a few kilobytes and sit next to package.json, tsconfig.json and .js files. Opening the file in Notepad or TextEdit settles it: readable code means TypeScript, a wall of garbled characters means video.

Transport stream videos are bulky because broadcast bitrates are high and the packet structure adds overhead. Converting them to MP4 usually saves space and improves compatibility with phones and editors. Downloaded HLS streams often arrive as many numbered segment files that must be joined in order before conversion.

What TS files are used for

  • Recordings from TV tuners, DVRs and set-top boxes
  • HLS live-streaming segments and downloaded streams
  • AVCHD camcorder footage (.mts, .m2ts) and Blu-ray video (.m2ts)
  • TypeScript source files in web, Node.js and React projects (.ts, .tsx)

How to open a .ts file

Windows

For video, play it in VLC; Media Player also opens many TS recordings. For TypeScript, open it in VS Code or Notepad.

Mac

QuickTime Player usually cannot open transport streams; use VLC or IINA. For TypeScript, use VS Code or any text editor such as TextEdit.

iPhone and iPad

VLC for Mobile plays TS video from the Files app. A TypeScript file can be previewed as text in Files or opened in a code editor app.

Android

VLC for Android or MX Player plays TS video; a text editor app shows TypeScript code.

How to convert a .ts file

For video, open the .ts in HandBrake and export an H.264 MP4, or remux without re-encoding using FFmpeg or VLC Convert / Save when the codecs inside are already H.264 and AAC.

TypeScript is not converted but compiled: run the TypeScript compiler (npx tsc) in the project folder to produce JavaScript files.

Renaming a video .ts to .mp4 does not convert it, and renaming a TypeScript file to .js will break any type annotations it contains.

Changing the extension in the file name does not convert the file. See how to change a file extension for when renaming is safe.

Naming and renaming TS files

  • DVR recordings get channel and timestamp names; rename them to Show Name - S01E03 style before adding them to Plex or Jellyfin so episodes are matched correctly.
  • When joining HLS segments, keep their zero-padded numbering (segment_0001.ts) intact until after merging, because the order is everything.
  • For TypeScript, follow your project's convention, typically kebab-case or camelCase file names, and use .tsx only for files that contain JSX.

Renaming lots of .ts files? See how to rename typescript files with ai, use the free online bulk renamer for patterns and numbering, or try File Renamer AI to name each file from what is inside it.

Related file types

Frequently Asked Questions

What is a .ts file extension?

It is either an MPEG transport stream video (broadcast recordings, streaming segments, camcorders) or a TypeScript source code file. Large binary files are video; small text files are TypeScript.

How do I play a .ts video file?

VLC plays transport streams on Windows, Mac, iPhone and Android. You can also convert it to MP4 with HandBrake for wider compatibility.

How do I open a TypeScript .ts file?

Open it in a code editor such as VS Code, or any plain text editor. To run it, compile it with the TypeScript compiler or use a runtime that supports TypeScript.

Are .mts and .m2ts the same as .ts?

They are transport stream variants used by AVCHD camcorders and Blu-ray discs, with a slightly larger 192-byte packet. VLC and HandBrake handle them like .ts.

More video file extensions · all file extensions