Strip TypeScript types from code
TypeScript to JavaScript strips type annotations using regex pattern matching, not the real TypeScript compiler, entirely in your browser. It handles common cases — simple parameter and variable type annotations, interface declarations, type aliases, and generic angle brackets — but pattern matching can misfire on code that merely resembles a type annotation. Most notably, a ternary expression followed by a comma in the same statement can get corrupted, since the colon looks like a type annotation to the regex.
Is TypeScript to JavaScript free to use?
Yes, it's completely free with no signup required.
Does it use the real TypeScript compiler?
No — it uses regex pattern matching to strip common type syntax, not the actual TypeScript compiler (tsc) or a TypeScript-aware transpiler like Babel.
Can it corrupt valid code?
In specific cases, yes — a ternary expression followed by a comma in the same statement can be misread as a type annotation and stripped incorrectly.
Is my code uploaded to a server?
No, conversion happens entirely in your browser.