Skip to main content

JavaScript Minifier

Minify JavaScript code for production by removing whitespace and comments.

minifycompressjavascript
Read the guide
Shortcuts:⌘ KSearch
For production use, consider running Prettier locally.
Lines: 0Characters: 0

Frequently Asked Questions

Is this the same kind of minification I would get from Terser or esbuild?

No. This tool removes comments and collapses whitespace, but it does not mangle names, fold constants, tree-shake, or do parser-level optimizations.

Will it remove comment markers that appear inside strings?

No for normal strings and template literals: the minifier keeps quoted text intact. Its weak spot is parser-unaware cases like regex literals, not string contents.

Why is my minified output still pretty readable?

Because the tool mostly strips spacing and comments around punctuation. It does not rename variables or rewrite expressions for maximum compression.

Does the minifier tell me if my JavaScript is invalid?

No. Like the formatter view it shares, it transforms text without doing real syntax validation first.

Do I have to click Minify every time?

Yes. There is no live minify mode; click Minify to generate output, then use Copy or Download if you want to reuse it.

Related Tools