← Free online tools

Minifier tools

JavaScript Minifier

Minify or beautify JavaScript, compare the size before and after, and copy the result. Comments and extra whitespace are removed without breaking automatic semicolon insertion.

Browser-only transform

Your code is processed in the browser and never uploaded.

This minifier removes comments (except /*! license */ comments) and extra whitespace. It keeps line breaks where removing them could change how JavaScript inserts semicolons, and it does not rename variables. For maximum compression in production, use a build tool such as esbuild or Terser.

Preserve literals

The parser keeps strings, templates, and regex literals intact while removing noise.

Beautify reset

Reformat compressed snippets for easier inspection and debugging.

Copy output

Copy minified or beautified code after checking size changes.

JavaScript Optimization Notes

Quick snippets

This tool is useful for small scripts and code review, while full apps should use a bundler or Terser.

Validate behavior

Run tests or browser checks after minifying complex generated scripts or syntax edge cases.

FAQ

What does JavaScript minification do?

It removes comments and unnecessary whitespace while keeping strings, template literals, and regular expressions intact. Line breaks that JavaScript needs for automatic semicolon insertion are kept, and /*! license */ comments are preserved. Variables are not renamed.

Can I beautify compressed JavaScript?

Yes. Beautify puts each statement and block on its own indented line so dense code is easier to read. It does not change the code itself.

Is pasted JavaScript uploaded?

No. Minify, beautify, copy, and clear run locally in your browser.

Related Tools

loresync tools publishes 160 free online tools.