TypeScript Type Stripper
Strip TypeScript type annotations from source code and get back plain JavaScript — either keeping modern syntax intact, or downlevel-transpiled to ES2020/ES2017/ES5. Uses the real TypeScript compiler (transpileModule), entirely in your browser.
Input
Output
| Metric | Value |
|---|---|
| No data yet | |
| Line | Message |
|---|---|
| No data yet | |
Guides
Paste TypeScript and get plain JavaScript back — with type annotations, interfaces, as casts and generics removed, but the rest of your code left alone. This free online tool uses the real TypeScript compiler (ts.transpileModule), the same engine tsc uses, entirely in your browser — nothing is uploaded.
How to use it
- Paste your TypeScript source code.
- Choose an Output target:
- Strip types only keeps modern JavaScript syntax intact (classes, arrow functions, optional chaining, template literals, top-level
await, …) and removes only TypeScript-specific syntax. - ES2020 / ES2017 / ES5 additionally downlevel-compiles the JavaScript itself for older runtimes, inserting TypeScript's inline compatibility helpers where needed.
- Strip types only keeps modern JavaScript syntax intact (classes, arrow functions, optional chaining, template literals, top-level
- Set JSX handling if your code contains JSX: preserve it as-is, convert it to
React.createElementcalls, or pick "No JSX in this code" for plain.tsfiles. - Toggle Preserve JSDoc comments to keep
/** ... */blocks even if other comments would be dropped, and Remove all comments to strip everything.
The output updates automatically as you type. If your code has a syntax error, the tool shows the parser's diagnostics (with line numbers) instead of guessing at broken output.
Does this type-check my code?
No. transpileModule is a single-file syntactic transform — it doesn't resolve imports or check types across files, so it can't catch a type error like passing a string where a number is expected. It will catch actual syntax errors (a missing bracket, an invalid token).
Will my modern JS syntax get rewritten?
Only if you pick a downlevel target (ES2020/ES2017/ES5). "Strip types only" targets the latest JavaScript, so your arrow functions, template literals, ??, ?., classes and async/await all pass through unchanged — only the TypeScript-only syntax is removed.
Is my code uploaded anywhere?
No. Transpilation runs entirely in your browser using the TypeScript compiler bundled with the page; your source is never sent to a server.
Need to format code instead of stripping types?
Use the JSON Formatter or SQL Formatter for other languages, or the JavaScript Minifier to compress the JavaScript this tool outputs.