MergeMintHub

Guides / JavaScript Minifier

How to Minify JavaScript and Shorten Variable Names

4 min read · Updated October 2026

Smaller scripts download and run sooner. A minifier removes spaces and comments, and can also rename local variables to short names.

Try it now: JavaScript Minifier

Free, no sign up, and the file stays on your device.

Open JavaScript Minifier

How to minify

  • Open JavaScript Minifier and paste your code.
  • Keep Shorten variable names on for the smallest output.
  • Copy the minified script.

If you get an error

The tool reports syntax errors in your code. Fix the reported problem, such as a missing bracket, and try again.

Test before publishing

Run your site with the minified script. Code that depends on function names or on code read as text can break when names are shortened, so turn the option off if you see problems.

Frequently asked questions

Is my data uploaded?

No. Everything runs in your browser, so what you type never leaves your device.