Data Format Conversions
TypeScript to JavaScript Converter
Workspace
Options
Detected automatically from .tsx files and JSX tags.
How to use this tool
- 1Paste TypeScript or open a .ts / .tsx file.
- 2Keep formatting, or choose Compile and a JavaScript version.
- 3Fix any syntax errors shown with their line numbers.
- 4Copy the JavaScript or download the .js file.
Frequently asked questions
"Keep my formatting" removes only the type syntax, so the JavaScript looks like your code. "Compile with TypeScript" runs the full compiler, which can also lower modern syntax to an older JavaScript version but reformats the code.
They have no JavaScript equivalent, so those statements are compiled by TypeScript into plain objects; the rest of the file keeps its formatting. Constructor parameter properties become this.x = x assignments.
No. Like Babel, esbuild and Node's type stripping, it converts one file without type-checking. Syntax errors are reported with line numbers; run tsc in your project for type errors.
import type statements and imports used only as types are removed, as the TypeScript compiler does. Other imports are kept as they are.
Related tools
JavaScript to TypeScript Converter
Start migrating JavaScript to TypeScript: JSDoc becomes annotations, class fields are declared and require becomes import.
JSON to TypeScript Interface Generator
Generate TypeScript interfaces or type aliases from sample JSON, with nested types and optional fields.
TypeScript to TXT Converter
Convert TypeScript source code to a clean .txt file, with optional comment removal, line numbers and whitespace clean-up.
Text Diff Checker
Compare two texts or files side by side or unified, by line, word or character, and download a unified patch.