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
A .mp4 file is a video container defined by the MPEG-4 Part 14 standard. It usually holds H.264 or H.265 video with AAC audio, plus optional subtitles, chapters and metadata. MP4 is the most widely supported video format: phones, browsers, TVs, editors and social platforms all play it without extra software.
A .mkv file is a Matroska video, an open, royalty-free container that can hold unlimited video, audio and subtitle tracks plus chapters and attachments in a single file. It is popular for films and TV rips because it keeps multiple languages and subtitles together. VLC plays it everywhere; Windows 11 Media Player plays most MKVs.
A .js file is a JavaScript source code file. Websites load JS files to add interactivity, and Node.js runs them as programs and tools on servers and computers. It is plain text you can read in any editor. Be careful: on Windows, double-clicking a .js file can run it as a script.
A .json file is a plain text data file in JavaScript Object Notation, a lightweight format of names, values, lists and nested objects. It is the standard way web APIs exchange data and a common format for app settings, exports and configuration. Any text editor opens JSON, and browsers can display it nicely.
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.