Skip to content

Free JavaScript Minifier Online

Paste or upload your JavaScript and compress it instantly using Terser. Dead code removal, variable mangling, and whitespace stripping — all in your browser.

Detected language:JavaScript
Loading editor...
Use this editor to input your HTML, CSS, or JavaScript code. The language is automatically detected. You can minify code to reduce file size or beautify it to improve readability. Files can also be uploaded by dragging and dropping them onto this editor. Keyboard shortcuts: Ctrl+Shift+M to minify, Ctrl+Shift+B to beautify, Ctrl+S to download.

About the JavaScript Minifier

JavaScript minification uses Terser — the same engine used by Webpack, Vite, Rollup, and most modern JavaScript build tools. Terser parses your code into an AST, applies transformations, and outputs the smallest valid JavaScript that behaves identically to your source.

Transformations include: removing comments and whitespace, shortening variable and function names, eliminating dead code branches, and collapsing constant expressions. The result is typically 30–60% smaller than the source.

Everything runs locally in your browser — your JavaScript is never sent to any server.

Powered by Terser

Terser is the successor to UglifyJS and the de-facto standard for JavaScript minification. It supports modern ES2020+ syntax including optional chaining, nullish coalescing, and async/await.

JavaScript Minifier FAQ

What JavaScript minification engine does this use?

MinifyTools uses Terser, the industry-standard JavaScript minifier used by Webpack, Vite, and most modern build tools. It provides production-quality minification including dead code elimination and variable name mangling.

Is it safe to minify production JavaScript here?

Yes. Your code is processed entirely in your browser and never leaves your device. There's no server-side processing, no logging, and no storage of your code.

How much can JavaScript minification reduce file size?

Typical savings are 30–60% depending on how your code is written. Well-commented, formatted code with long variable names sees the biggest reductions. Combined with gzip, you can often achieve 80%+ total compression.

Will minified JavaScript still work correctly?

Yes. Terser minification is safe — it analyses your code's AST (abstract syntax tree) before transforming it, ensuring variable renaming is consistent throughout. The output is functionally identical to your source.

Other minifiers