TypeScript to JavaScript
Transpile TypeScript to ES2020 JavaScript with the TypeScript compiler, reporting syntax errors by line.
What this transpiler does
Turn TypeScript into ES2020 JavaScript with the real TypeScript compiler, not a regular expression that deletes type annotations. Interfaces, generics, enums, decorators and type-only imports are handled by the compiler that defines them, and a syntax error is reported with its line and column.
How to use it
Paste TypeScript and run it. The output is the transpiled JavaScript plus the input and output character counts. The compiler transpiles each file on its own, so cross-file type checking is out of scope; the page says that rather than implying a full build.
Privacy and safety
The source is sent to the tool server for that request, transpiled in a child process, and not stored. The compiler is the copy already installed in this deployment, so there is no network fetch and no third-party service.
Paste TypeScript and the server runs the TypeScript compiler's transpile step, returning JavaScript at the ES2020 target with ES modules and JSX left in place.
This is a real parse and emit, not a regular-expression stripper. Generics, interfaces, type aliases, enums and decorators are handled by the compiler that defines them, so a construct that looks like syntax but is not TypeScript is not silently mangled.
It transpiles syntax; it does not type-check. A file whose only problem is an assignment of the wrong type will come back as valid JavaScript, because the compiler is asked to emit rather than to build a program.
What the output is
The target is ES2020 and the module kind is ESNext, so import and export statements stay as written rather than becoming a CommonJS wrapper. JSX is preserved, which means a .tsx file's markup is not converted to React.createElement here.
The response reports the input and output character counts alongside the code. A syntactic diagnostic stops the conversion and is returned with the line and column of the first error, so a missing brace is locatable rather than merely reported.
- Target: ES2020
- Module: ESNext; JSX preserved
- Up to 200,000 characters, 30-second timeout
What it does not decide
Type checking, declaration emission and bundling are separate jobs. A type error that does not break the syntax is emitted as ordinary JavaScript, because types are erased rather than verified. A project that needs those checks should run tsc in its own build.
Decorator semantics depend on compiler options this page does not expose, and JSX preservation means the output still needs a JSX-aware build step. The page is useful for seeing the JavaScript a file becomes, not for producing a deployable bundle.
How to use the transpile form
Paste the TypeScript source, up to 200,000 characters, and press Run; the server transpiles with the real compiler and returns ES2020 JavaScript beside the input and output character counts. Modules stay ESNext and JSX stays in place.
A syntax error stops the run with the line and column of the first problem; fix it and run again. A clean run that still looks wrong is usually a type error, which the transpile erases rather than reports, so check types in a real build.
What to Expect
Best for
- Seeing the JavaScript a TypeScript snippet becomes
- Checking that a syntax error is real before a build
- Removing type syntax from a file by hand
Not ideal for
- Type checking or declaration files
- Producing a bundle, which needs a bundler
- A file over 200,000 characters
What this tool keeps
- Runtime behaviour, since types are erased rather than rewritten
- Import and export statements in ESNext form
- JSX markup, which is left for a later step
What may need cleanup
- Type errors, which the transpile does not report
- Decorator output, which depends on options the page does not expose
- JSX, which still needs a JSX-aware build
Common errors
- Expecting a type error to stop the conversion
- Pasting a .tsx file and expecting React.createElement calls
- Reading the character counts as a size measurement of the source file
Example use cases
- Learning what an interface compiles away to
- Checking a snippet before pasting it into a build
- Producing JavaScript for a quick test
Sample input
A 40-line TypeScript module with an interface, a generic function and one exported const.
Sample output
The same module as ES2020 JavaScript with the interface and type annotations removed, plus the input and output character counts.
Who this is for
- TypeScript developers
- Students learning type erasure
- Reviewers checking an emitted snippet
Frequently asked questions
What does TypeScript to JavaScript output?
JavaScript at the ES2020 target with ES modules and JSX left in place, produced by the compiler's transpile step.
Does it type-check the code?
No. Types are erased, and type errors are not reported.
Does it produce a bundle?
No. A bundler is needed for that.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.