.ts File Extension

Learn what a .ts file is, how to open TypeScript source or MPEG transport streams, and how Poly handles this ambiguous suffix.

File extension details for .ts

Partial Support
File typeTypeScript source code or MPEG-2 transport stream
MIME type
EncodingUnicode source text, commonly UTF-8, or a binary MPEG-2 transport stream
Operating systemsWindows, macOS, Linux
Opens withVisual Studio Code, WebStorm, Visual Studio, VLC media player
Poly supportPartial. Poly recognizes .ts as readable source text; MPEG transport streams receive basic file handling.
Indexed by PolyYes for readable source. MPEG transport streams remain searchable by filename.
Preview in PolyYes for TypeScript source. MPEG transport streams do not receive format-aware playback.
Poly agentYes for readable source text. The agent does not inspect binary transport-stream content.

What kind of file is a .ts?

A .ts file usually contains TypeScript source code. TypeScript adds static type checking and type syntax to JavaScript. Its compiler normally removes the types and emits JavaScript, although a project can use noEmit when another tool produces the runnable output.1

The suffix is also used for a binary MPEG-2 transport stream, especially broadcast recordings and segmented video. That meaning has the registered video/MP2T media type. Transport streams consist of 188-byte packets, each normally beginning with the synchronization byte 47 in hexadecimal.23

These two formats are unrelated. TypeScript is readable source text and has no fixed magic bytes. A transport stream is binary and usually repeats the 47 sync byte every 188 bytes. Inspect the content rather than trusting the filename.

Renaming clip.ts to clip.mp4 does not convert or remux the video. Renaming JavaScript to .ts does not add useful types or prove that the program passes TypeScript's checks.

How do I open a .ts on my computer?

For TypeScript, use Visual Studio Code, WebStorm, Visual Studio, Vim, Neovim, or another code editor. Visual Studio Code includes TypeScript language features, but its documentation notes that the tsc compiler must be installed separately.4 In a project with tsconfig.json, run the local compiler from the project directory:

npx tsc --noEmit

This checks the project without creating JavaScript output. Review package scripts and dependencies before running commands in an unfamiliar repository.

For an MPEG transport stream, open the file with VLC or inspect it with FFmpeg. VideoLAN documents support for MPEG transport-stream input.5 A media probe can identify the contained video, audio, timing, and subtitle streams before conversion.

Poly support for .ts

Poly treats .ts filenames as readable source code. TypeScript source opens in a code-friendly viewer with syntax highlighting, word wrap, and in-file search. Its text is indexed for exact and semantic search, and the Poly agent can summarize functions, explain types, and reason about the source without executing it.

Poly does not run tsc, resolve imports, install dependencies, or reconstruct the project's type-checker state. Keep tsconfig.json, related modules, declarations, and package metadata alongside the file when those details matter.

The binary video meaning is not inferred from .ts as a filename convention. MPEG transport streams remain stored and searchable by name, but they do not receive format-aware playback, transcription, visual search, or agent reading.

History of .ts

MPEG-2 was approved in November 1994, establishing the transport-stream structure used for digital television and transmission.6 TypeScript was unveiled publicly on October 1, 2012, and reached version 1.0 on April 2, 2014.78 The same short suffix therefore acquired two independent meanings.

The surrounding project usually resolves the ambiguity. A .ts file beside tsconfig.json, package.json, and other source is probably TypeScript. A large file from a recorder, broadcast workflow, or streaming pipeline is more likely transport video.

Working with .ts and alternatives

Choose the workflow after identifying the content:

ContentTypical next stepRelated files
TypeScript sourceType-check or compile with the project's configured toolchain.tsx, .mts, .cts, .d.ts, .js
MPEG transport streamPreserve it, remux compatible tracks, or transcode for the destination.m2ts, .mts, .mp4, .mkv

TypeScript compilation can emit a separate .js file, declarations, and source maps. MPEG remuxing changes the container without re-encoding compatible tracks, while transcoding decodes and re-encodes media and may reduce quality. In both cases, conversion creates a new artifact. A filename change alone does not change the contents.

Footnotes

  1. TypeScript. TypeScript for the New Programmer. Explains static checking, the relationship to JavaScript, and type erasure.
  2. Internet Assigned Numbers Authority. Video Media Types Registry. Registers video/MP2T for MPEG-2 transport streams.
  3. Internet Engineering Task Force. RFC 4326: Unidirectional Lightweight Encapsulation for Transmission of IP Datagrams over an MPEG-2 Transport Stream. Defines the 188-byte packet and 0x47 synchronization pattern.
  4. Microsoft. TypeScript in Visual Studio Code.
  5. VideoLAN. VLC Features. Lists MPEG transport-stream input support.
  6. Moving Picture Experts Group. Who We Are. Records MPEG-2 approval in November 1994.
  7. TypeScript. Ten Years of TypeScript. Dates the public unveiling to October 1, 2012.
  8. TypeScript. Announcing TypeScript 1.0. Published April 2, 2014.
© Poly Corp. 2026