Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / JavaScript Minifier

JavaScript Minifier

Paste JavaScript to strip comments and extra whitespace. Runs entirely in your browser — nothing is uploaded or executed.

Safe by design

This strips comments and leading and trailing whitespace but keeps line breaks. Collapsing everything onto one line is how naive minifiers break code through automatic semicolon insertion (a bare return followed by a value on the next line, for example).

No surprises

You get a smaller file that behaves exactly like the original.

Quick snippets

Good for inline scripts and small files where a bundler is overkill.

Size feedback

See original size, minified size and percentage saved.

For big projects

Use a real bundler such as esbuild for variable renaming and dead-code removal.

Frequently asked questions

Why are line breaks kept?

Removing them can change how the code runs. Keeping them trades a smaller saving for never breaking your script.

Does it rename variables?

No. That needs a full parser and a build step.

Is my code uploaded?

No. Everything runs locally.

More free tools

Ship smaller scripts. Then make sure the site still works.

Upzilla checks your pages and endpoints from several regions, around the clock.

Start monitoring free →