Quecko Logo

Free tool • Runs in your browser

JavaScript minifier

Minify JavaScript with Terser to reduce size, with optional name mangling.

Loading tool...

Quick answer

Terser removes whitespace and comments, simplifies code and can shorten local variable names. It reports syntax errors with a position, and modern JavaScript is supported.

How to use it

  1. Paste your JavaScript.
  2. Choose your options and minify.
  3. Copy the output and test it.

Example

Input
function add(first, second) {
  return first + second;
}
Output
function add(n,d){return n+d}

Common errors and how to fix them

Unexpected token
The code has a syntax error, or uses JSX or TypeScript, which need compiling first.
The code stopped working
Turn off mangling if the code depends on local names, then test again.

Frequently asked questions

How do I minify JavaScript online?

Paste your code here, choose your options, and press Minify. It uses Terser.

What is JavaScript minification?

It removes whitespace and comments, simplifies code, and can shorten local variable names to reduce the file size.

How do I minify a JavaScript file?

Paste the file's contents here and download the result. Build tools can also do this automatically.

How do I minify JavaScript in VS Code?

Use an extension that minifies files, or paste your code here.

How do I minify JavaScript in WordPress?

Use a caching or optimisation plugin, then test your site, as combining scripts can sometimes break features.

What is the difference between minifying and compressing JavaScript?

Minifying rewrites the code to be smaller. Compression such as gzip or Brotli happens when the server sends it, and you can use both.

Does minifying protect my JavaScript code?

No. Minifying is not encryption, so never put secrets in client-side code.

Does it support TypeScript or JSX?

No. Compile them to JavaScript first.

Why did my code stop working after minifying?

Turn off name shortening if your code depends on local names, then test again.

Is what I paste uploaded?

No. Everything runs in your browser and nothing is sent to Quecko.

More developer tools

Need something built for your business?

Quecko designs and builds AI, Web3 and custom software products.

Start a Project