JavaScript Minifier / Beautifier

Minify JavaScript with Terser engine used by webpack and Next.js. Variable renaming, dead code elimination, ES6+ support. 3 presets, beautify mode. Free, no signup.

Paste JavaScript or drop a file

tuneMinification Preset

boltPowered by Terser - the same engine used by webpack and Next.js

About this tool

The JavaScript Minifier uses Terser, the same production-grade engine used by webpack, Next.js, and Vite. It provides real minification with variable renaming, dead code elimination, and tree shaking - not just whitespace removal.

Choose from three presets: Safe (whitespace and comments only), Standard (variable mangling and compression), or Aggressive (maximum compression with console removal). Fine-tune with advanced options for full control.

Use Beautify mode to unminify compressed JavaScript back to readable, properly indented code. All processing runs entirely in your browser using Terser - your code never leaves your device.

Frequently Asked Questions

What engine does this use?

This tool uses Terser, the same production-grade JavaScript minifier used by webpack, Next.js, Vite, and Rollup. It runs entirely in your browser for privacy.

What are the preset options?

Three presets: Safe (removes comments and whitespace only), Standard (adds variable renaming and dead code elimination), and Aggressive (maximum compression with console.log removal). You can also customize individual options.

Does it support modern JavaScript?

Yes. Terser fully supports ES6+ syntax including arrow functions, classes, async/await, template literals, optional chaining, nullish coalescing, and more.

Can I unminify JavaScript?

Yes. Click the Beautify button to format minified JavaScript with proper indentation. Choose between 2-space, 4-space, or tab indentation.

What does variable mangling do?

Variable mangling renames local variables to shorter names (a, b, c) to reduce file size. It only renames variables that are safe to rename - function parameters, local variables, etc. Global variables and property names are preserved.

Related Tools