Home » Developer Tools » TypeScript Minifier

TypeScript Minifier

Paste TypeScript and get smaller working JavaScript in seconds, right in your browser.

Last updated 13 November 2026

Upload a file: or paste code below.
Input0 chars
Output0 chars
Original size0 B
Result size0 B
Change0%

Your code never leaves your browser. Everything runs locally on your device.

TypeScript files carry extra information that browsers do not need: type annotations, interfaces, and enums. The TypeScript Minifier removes that type layer and shrinks the remaining JavaScript, so your code stays working but downloads faster.

This page is built for real TypeScript, not for plain JavaScript with the labels changed. Interfaces and type aliases are removed, enums become JavaScript objects, and generics are stripped, all before the code is minified. Everything runs in your browser, so your code is never uploaded to a server.

How to Minify TypeScript

  1. Paste your code: paste TypeScript into the input box or upload a TS file.
  2. Choose your options: keep comment stripping on for the smallest output, or turn it off to keep your comments.
  3. Click Minify TypeScript: your minified JavaScript appears instantly in the output box.
  4. Copy or download: copy the result or download it as a JS file for your project.

Why Use This TypeScript Minifier

Worked Example: Real TypeScript Before and After

Here is a real file run through this tool. A test file of 189 characters holds an interface, a typed constant, a typed function and a generic array. The minified output is 89 characters, 53 percent smaller: the interface is gone, the types are stripped, and the result is valid JavaScript that runs as it did before. That matches the live test exactly.

A TSX file works too. A Card component of 116 characters, with a type for its props and JSX in the return, comes out as 127 characters of plain JavaScript that calls the React JSX runtime. Before the fix, the same file gave no output at all, only an error about a missing comma, because the compiler had no JSX option set.

TSX Support and Decorators

The page uses the TypeScript 5.5 compiler in your browser, with the JSX option set to the React JSX transform. That is why TSX files now minify instead of erroring. The output calls the React JSX runtime, so it needs React where it runs. Plain TypeScript without JSX is unchanged, and the file picker accepts TS, TSX and JS files.

Decorators use the classic legacy transform, so the usual decorator style compiles the way its authors expect. Enums become JavaScript objects with the reverse mapping, so code that reads the enum by name or by value keeps working. Interfaces, type aliases and generics are stripped from functions, classes and calls.

What This Minifier Cannot Do Yet

This minifier does not rename variables. Names are kept as they are, so the output stays easy to read and debug, and the saving is smaller than a mangling minifier gives. It does not bundle files either: it minifies the code you paste or upload, one file at a time, and it does not resolve imports.

If the TypeScript compiler library fails to load, the page falls back to a simple stripper that cannot handle TSX, namespaces or multi line decorators. Refresh the page so the library loads if you see that fallback message. And as with any minifier, run the output yourself before you ship it, because the tool strips types but does not run your code.

Frequently Asked Questions

Is the TypeScript Minifier free to use?

Yes, it is completely free with no sign up.

What does the minifier output: TypeScript or JavaScript?

JavaScript. Type annotations, interfaces, and type aliases are removed, and enums become JavaScript objects, so the output is plain JavaScript.

Will my minified code still work the same way?

Yes, for the constructs the tool supports. The logic of your code is unchanged; only types, comments, and extra whitespace are removed.

Does it handle interfaces, generics, and enums?

Yes. Interfaces and type aliases are removed, generics are stripped from functions, classes, and calls, and enums are converted to JavaScript objects.

Is my code uploaded to a server?

No. All minifying happens in your browser on your own device, so your code never leaves your computer.

What happens if my TypeScript has a syntax error?

The tool shows a clear error message and keeps your input untouched, so you can fix the error and try again.

Does it work with TSX files?

Yes. Paste JSX code or upload a TSX file. The JSX is transformed to plain JavaScript that calls the React JSX runtime, so the output needs React where it runs. Before, TSX gave no output at all, only an error about a missing comma.

Do decorators still work?

Yes, for the usual legacy style. Decorators are kept and compiled with the classic transform, so a decorated class comes out with the familiar __decorate helper.

Does it rename my variables?

No. Variable and function names are kept as they are, so the output stays easy to read and debug. That is also why the saving is smaller than a mangling minifier gives.

What TypeScript version does it use?

The TypeScript 5.5 compiler shipped on this page, running in your browser. Your code never leaves your computer, and there is no server step.

Can I minify plain JavaScript here?

Yes. The file picker also accepts JS files. Types are already absent, so only comments and whitespace are stripped, and the result is still valid JavaScript.

↑