TypeScript Minifier

Strip TypeScript down to a compact single line — comments and whitespace gone, with one-click beautify to bring it back.

TypeScript709 B
TypeScript · 709 B · runs locally

What this tool does

Paste TypeScript — modules, interfaces, classes, snippets for a payload or a code golf — and hit Minify to strip comments, newlines, and whitespace in place, with the percentage saved shown in the status bar. Beautify goes the other way, pretty-printing the document with Prettier when you need to read it again. The editor gives you full TypeScript syntax highlighting, and everything runs in your browser — nothing is uploaded.

How to use it

  1. Paste your TypeScript into the editor — or hit Upload to open a .ts or .tsx file from your machine.
  2. Click Minify to strip comments and whitespace in place — the status bar shows the size and the percentage saved.
  3. Click Beautify whenever you need it readable again — Prettier re-indents the document in place.
  4. Copy the result, or Download it — the file follows the active mode: .min.ts after Minify, .ts otherwise.

Frequently asked questions

Is my TypeScript uploaded anywhere?
No. Minifying and beautifying run entirely in your browser. Nothing is sent to a server, logged, or stored.
How much smaller does minified TypeScript get?
It depends on how much whitespace and commentary the input carries — typical well-commented source shrinks by 30–50%. The status bar shows the current byte size, and a chip shows the exact percentage saved after each Minify.
What does the minifier remove?
Line comments (//), block comments (/* … */), newlines, and whitespace around punctuation. It does not rename identifiers or perform compiler-level optimizations — for production bundles use a build tool like esbuild, swc, or terser after compiling to JavaScript.
Can I undo a minify?
Yes — hit Beautify to pretty-print the document back into readable, indented TypeScript (powered by Prettier). Note that stripped comments are gone for good, so keep a copy if the comments matter.
Does minified TypeScript still compile?
The transform is whitespace- and comment-level, so ordinary code keeps its meaning. Be aware that aggressive whitespace collapsing can touch spacing inside string literals that contain punctuation — double-check strings if the exact text matters.