developer tools100% Client-Side • Zero Data UploadedNew

JavaScript Minifier

Minify modern JavaScript using Terser directly in your browser. Remove comments, shorten syntax, optionally mangle local identifiers, and compare compressed output sizes without sending source code to a server.

Powered by Terser for production-grade minification
Optional syntax compression and local identifier mangling
Automatic syntax error reporting with line details
Original vs minified size comparison
Source JavaScript
Minified Output

About JavaScript Minifier

JavaScript minification removes comments and unnecessary whitespace, shortens expressions, and can rename local variables. It reduces download size and parse time for production bundles.

How to Use This Tool

  1. 1Paste your JavaScript source into the editor.
  2. 2Choose whether to enable compression and identifier mangling.
  3. 3Click Minify JavaScript and review the output and size savings.
  4. 4Copy or download the result for your build pipeline.

Common Pitfalls to Avoid

  • Minifying already-bundled code multiple times without measuring the benefit.
  • Enabling mangling for code that relies on function or variable names at runtime.
  • Using minification as a substitute for removing secrets from client code.
Privacy First ArchitectureAll operations performed in this tool execute entirely within your local browser's JavaScript runtime. No data is submitted to any server or recorded anywhere. You can safely inspect confidential schemas and payloads.

Practical Examples

Minify a JavaScript functionA simple function is minified by removing whitespace and shortening the parameter name.
Input
function greet(name) {
  return "Hello, " + name;
}
Output
function greet(n){return"Hello, "+n}

Common Use Cases

  • Reduce JavaScript bundle size for production deployments.
  • Optimize parse time for client-side scripts.
  • Prepare code for performance optimization reviews.

Frequently Asked Questions

No. Terser runs inside your browser, so the source code you paste never leaves your device.