JS Minifier

Compress your JavaScript code by removing whitespace, comments, and shortening variable names.

  1. Home
  2. Web Dev
  3. JS Minifier
Example
0 chars | 0 lines

What is JS Minifier?

A JavaScript Minifier is a tool that reduces the size of your JavaScript code by removing unnecessary characters, shortening variable names, and optimizing syntax — all without altering the behavior of your code. This process is also known as JS compression or JS uglification.

Smaller JavaScript files lead to faster downloads, reduced bandwidth usage, and improved Time to Interactive (TTI). The tool uses Terser, the industry-standard JavaScript parser and compressor used by Webpack, Vite, and most modern build tools.

How to Use This JS Minifier

  1. Paste your JavaScript code into the input textarea above.
  2. Customize the minification options (compress, mangle, drop console, etc.).
  3. Click "Minify JS" to compress your code.
  4. Copy the minified output using the copy button.

Frequently Asked Questions

Will minification break my JavaScript code?

When using standard options (compress + mangle), minification is designed to preserve functionality. However, if your code relies on Function.prototype.toString() or accesses global variables by name, you may want to disable mangling. Always test your minified code in production.

Is my JavaScript code stored on a server?

No. All processing happens entirely in your browser using the Terser library. Your JavaScript code never leaves your device.

What is the difference between compress and mangle?

Compress optimizes the code structure by removing dead code, simplifying expressions, and inlining variables. Mangle shortens variable and function names (e.g., myVariable becomes a). Both together yield the best compression ratio.

Last updated: 24 Jun 2026