Skip to content

JavaScript Minifier

Minify JavaScript with Terser: remove whitespace and comments, shorten variable names and drop dead code.

Runs in your browserJavaScript → JavaScript
Loading tool…

Example

Input
function add(first, second) {
  // sum two numbers
  const total = first + second;
  return total;
}
console.log(add(1, 2));
Output
function add(d,n){return d+n}console.log(add(1,2));

How to use the JavaScript Minifier

  1. Paste or type your JavaScript into the input area, or open a file from your device.
  2. Adjust the options above the editor if the tool offers any.
  3. Review the JavaScript result, then copy it or download it as a file.

Privacy and limitations

  • Your data is processed on your device and is not uploaded to any server.

Frequently asked questions

Will minifying change how my code behaves?

No. Terser only applies transformations that keep behaviour identical. Turn off "Mangle" if other scripts access your local names via eval or Function.toString.

Browse all minifiers →