Skip to content

TypeScript to JavaScript Converter Online — TS/TSX to JS/JSX

Strip TypeScript types — annotations, interfaces, type aliases and generics — and get plain JavaScript. It works for .ts and .tsx: JSX is kept as-is, so a TSX component becomes JSX. The code is converted on the server; nothing is type-checked, bundled or run.

See what a TypeScript snippet looks like as plain JavaScript before using it in a JS project.

Code is converted on the server. No type-checking, execution or dependency bundling is performed. JSX is preserved.

Load an example (replaces your input)

TypeScript

JavaScript

When to use it

  • See what a TypeScript snippet looks like as plain JavaScript before using it in a JS project.
  • Turn a React .tsx component into .jsx by removing prop types while keeping the JSX.

How to use

  1. Paste TypeScript or TSX, or load an example (interface and function, generics, JSX). Loading an example replaces your input.
  2. Read the JavaScript on the right. Type annotations and interfaces disappear; code that exists at runtime, such as an enum, is emitted as JavaScript.
  3. Copy the result. If you need type safety, type-check the original TypeScript separately with tsc --noEmit.

TypeScript input

interface User { name: string }
const greet = (user: User): string => "Hello, " + user.name;

JavaScript output

const greet = user => "Hello, " + user.name;

Details and limitations

Your code is sent to the douni.one server to be converted. Do not paste secrets, API keys or source code you cannot share.

Removing types is not type-checking: const count: number = "text" converts without an error. Check types with the TypeScript compiler.

JSX stays JSX. To run React components in a browser you still need your project's JSX build step.

Constructs with runtime values, such as enum, produce JavaScript code instead of disappearing.

Only the pasted code is converted: imports are not resolved, files are not bundled, and modern syntax is not downleveled for older browsers.

FAQ

Can I convert TSX to JSX?

Yes. Paste the .tsx component: prop types and interfaces are removed and the JSX is left unchanged, so the result can be saved as .jsx. Compiling JSX into React.createElement calls is not part of this tool.

How is this different from running tsc?

tsc type-checks a whole project and can emit JavaScript for a chosen target. This page only strips types from the code you paste with Babel's TypeScript transform, keeps modern syntax, and never reports type errors. For whole projects, run tsc or a bundler such as esbuild locally.

Why did it convert code that has type errors?

The conversion is syntactic. It does not check assignments or function calls against their types, so run the TypeScript compiler in your project to find type errors.

What should I check when I get a syntax error?

Look at the reported line and column, the brackets around it and any type annotation there. Reducing the code to a small snippet helps isolate the problem; for a connection error, use Retry.

Specifications and references