JavaScript Minifier

Minify and compress JavaScript code

Share this tool

Report a problem

Describe the problem without including private input or files.

How useful was this tool?

How useful was this tool?

Input JavaScript

Removes comments and debugger statements, keeps console logs.

Your code is never uploaded or stored.

JavaScript minification tips
  • Test your minified JavaScript before deploying it.
  • Keep original source files for debugging.
  • Use name mangling with care when your code relies on function or class names.
  • Combine minification with gzip or Brotli compression.
  • Use build tools to automate minification in production.

Minified JavaScript

Compression results

Original size
—
Minified size
—
Bytes saved
—
Compression
—
Lines
—
Before & after

Before

—

After

—

About JavaScript Minifier Tool

Our free online JavaScript minifier compresses your JS code by removing whitespace, comments, and unnecessary characters to produce the smallest possible output. It fully supports modern ES6+ syntax, including arrow functions, template literals, classes, destructuring, and more.

Choose from three minification levels to match your needs. The Safe preset keeps all comments and variable names intact. The Recommended preset strips comments and debugger statements while preserving console logs. The Aggressive preset enables full name mangling, dead code elimination, and console log removal for maximum file size reduction.

Your JavaScript code is never uploaded to any server. The tool provides detailed compression statistics showing original size, minified size, bytes saved, compression percentage, and line count reduction. Simply paste your code, choose a preset, and get optimized JavaScript instantly.