TypeScript to JavaScript

Transpile one TypeScript or TSX source into JavaScript for use elsewhere.

Input

Processed on your device

How to convert TypeScript to JavaScript

Generate JavaScript from TypeScript with a selected output language target. Useful for inspecting how a snippet or one source file is emitted.

  1. Paste the source, select Output target and enable Parse JSX markup for TSX if needed.
  2. Convert and review the resulting imports and browser compatibility.
Example input
const label: string = "Field Notes";
export const copies: number = 12;

Example use

Compare how a function using modern TypeScript emits ES2022 and ES5 JavaScript before incorporating it into a build.

Output and compatibility

The compiler transpiles one module. It does not resolve a dependency graph, bundle files, run full type-checking or automatically polyfill runtime APIs. JSX can introduce runtime imports.

Troubleshooting

If a result cannot run on its own, look for imports and APIs that require the rest of your application. Use its normal compiler for full project diagnostics.

Use JavaScript Formatter to inspect emitted JavaScript.

Frequently asked questions

Does ES5 target add polyfills?

It lowers supported syntax and does not add all runtime APIs.

Can I paste React JSX in a TSX snippet?

Enable Parse JSX markup. The output can still need a JSX runtime from your project.

Find a tool