JavaScript Minifier

Strip comments and whitespace from JavaScript — with size savings and one-click Prettier beautify.

JavaScript635 B
JavaScript · 635 B · runs locally

What this tool does

Paste JavaScript — snippets, bookmarklets, inline scripts, embed code — and hit Minify to strip comments and whitespace in place, with the percentage saved shown in the status bar. Beautify goes the other way, reformatting the document with Prettier when you need to read it again. The editor highlights syntax problems as you type, and everything runs in your browser — nothing is uploaded.

How to use it

  1. Paste your JavaScript into the editor — or hit Upload to open a .js 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 to pretty-print the document with Prettier whenever you need it readable again.
  4. Copy the result, or Download it — the file follows the active mode: .min.js after Minify, .js otherwise.

Frequently asked questions

Is my JavaScript uploaded anywhere?
No. Minification and beautification run entirely in your browser. Nothing is sent to a server, logged, or stored.
What does the minifier actually remove?
It strips line and block comments, newlines, and redundant whitespace around punctuation. It does not rename variables, drop dead code, or rewrite syntax the way a build-tool minifier like Terser does — the output is your code, just smaller.
How much smaller does minified JavaScript get?
It depends on how heavily the source is commented and indented — typical hand-written code shrinks by 25–50%. The status bar shows the byte size, and a chip shows the percentage saved by the last minify.
Can I get readable code back after minifying?
Yes — Beautify reformats the document in place with Prettier, the same engine behind the JavaScript Formatter. Comments stripped by Minify are gone for good, though, so beautify a copy if you need them.
Is the minified output safe to ship?
For most code, yes — but because the minifier joins lines textually, code that relies on automatic semicolon insertion (statements without semicolons) can change meaning. Give the output a quick run before shipping, or use a parser-based minifier in your build pipeline for production bundles.