Skip to main content

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

Plain JavaScript output
 
Summary
MetricValue
No data yet
Diagnostics
LineMessage
No data yet
Was this helpful?

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

  1. Paste your TypeScript source code.
  2. 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.
  3. Set JSX handling if your code contains JSX: preserve it as-is, convert it to React.createElement calls, or pick "No JSX in this code" for plain .ts files.
  4. 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.

typescriptjavascripttranspilestrip typescompilerdeveloper

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.