.TSX file extension
To open .TSX files on Windows, right-click the .tsx file and choose Open with → Visual Studio Code (or another code editor).
To open a .tsx file, use a source-code editor such as Visual Studio Code or another text editor. If you want it to run, it must be compiled/transpiled as part of a TypeScript project that supports JSX.
Last updated: June 12, 2026
Open on your device
Choose your operating system for a dedicated step-by-step opening guide.
How to open .TSX files
Use these platform-specific instructions to open .TSX files safely.
Windows
- Right-click the .tsx file and choose Open with → Visual Studio Code (or another code editor).
- If it opens in the wrong program, change the file association to a text/code editor and reopen.
Mac
- Right-click (or Control-click) the .tsx file → Open With → a code editor (for example, Visual Studio Code).
- If macOS asks for an app, pick a code editor or open it from within the editor using File → Open.
Linux
- Open the .tsx file with your preferred code editor (for example, Visual Studio Code) from the file manager or via the editor’s Open command.
- If it opens as plain text without highlighting, set the language mode to TypeScript/TSX in the editor.
iOS
- Use a text/code editor app that can view plain-text source files; for full TypeScript/JSX workflows, transfer the file to a desktop environment.
Android
- Open the file with a text editor that can display plain text; for compiling/building TSX, move the project to a desktop setup.
Security notes
- A .tsx file is plain-text source code, but it can contain logic that executes when included in an application build/run; treat TSX from untrusted sources as potentially malicious code.
- Be cautious with projects that include build scripts and dependencies: opening a .tsx file is safe as text, but running install/build/test commands can execute code.
- If you use editor extensions that automatically run code actions or project scripts, review what they do before trusting an unknown TSX project.
Before you run downloaded code
These files usually need a runtime (Python, Node, Java, …). They are not classic “file viruses,” but untrusted code can still do serious harm if you execute it. Prefer official packages, verify publishers, and scan archives or sketchy downloads when you are unsure.
Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.
NortonNorton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.
We may earn a commission when you use affiliate links. This supports our free file extension guides.
Can't open this file?
These are the most common causes and fixes when .TSX files fail to open.
Common reasons
- The file opens, but JSX looks like syntax errors
- TypeScript compiler errors because JSX isn’t enabled
- Double-clicking tries to run it or opens the wrong app
Fix steps
- Confirm the file extension is .tsx (not .ts).
- In your editor, select the language mode for TypeScript React/TSX (wording varies by editor).
OS-specific troubleshooting
What is a .TSX file?
A TSX file is a TypeScript file that embeds JSX (XML-like syntax used to describe UI elements). TypeScript’s JSX support expects JSX-containing code to be saved with the .tsx extension so the compiler parses it correctly. TSX is plain text source code, not a standalone executable format.
Background
TSX is the conventional file extension for TypeScript code that includes JSX. TypeScript introduced the .tsx extension to support embedding JSX directly in TypeScript source files, enabling typed UI component code that looks similar to JSX used in JavaScript.
Further reading
Authoritative resources for more details on the .TSX format.
- TypeScript Handbook: JSX
- What’s new in TypeScript 1.6 (TypeScript Wiki): .tsx extension for JSX
- JavaScript XML (JSX) overview (Wikipedia)
- TSX File: What is a .tsx file and how do I open it? (FileInfo)
- IANA Media Types registry (for checking official MIME registrations)
- Shared MIME-info Database specification (freedesktop.org)
Common .TSX issues
The file opens, but JSX looks like syntax errors
If the editor or tooling treats the file as plain TypeScript (.ts) or JavaScript, the embedded JSX may be flagged as invalid syntax.
- Confirm the file extension is .tsx (not .ts).
- In your editor, select the language mode for TypeScript React/TSX (wording varies by editor).
TypeScript compiler errors because JSX isn’t enabled
TypeScript only parses JSX when configured for it; otherwise you may see compiler errors or failed builds.
- Ensure you are using a TypeScript setup that supports JSX and that the file is .tsx as required for JSX-containing files.
- Follow the TypeScript JSX documentation for the correct project/compiler configuration.
Double-clicking tries to run it or opens the wrong app
.tsx files are source code; operating systems may not know the correct default application and may prompt or choose an unrelated program.
- Open the file from within a code editor using File → Open.
- Set the default app for .tsx to your code editor (file association) and try again.
FAQ
Is .tsx the same as .ts?
Both are TypeScript source files, but .tsx is used when the file contains JSX. TypeScript’s documentation states that files containing JSX should use the .tsx extension.
What is JSX and why is it inside TypeScript?
JSX is an XML-like syntax used in JavaScript ecosystems to describe UI structure. TypeScript supports JSX, and TSX is the standard extension for TypeScript files that embed JSX.
Can I open a .tsx file in a normal text editor?
Yes. TSX is plain text, so any text editor can open it. A code editor is recommended for syntax highlighting and TypeScript/JSX-aware features.
When did TypeScript start using .tsx?
TypeScript introduced the .tsx file extension to support embedding JSX starting with TypeScript 1.6.
Similar file extensions
Compare related formats in the same category to find the right tool faster.