Free JavaScript Minifier

Minify JavaScript with Terser to shrink and optimize your code.

Loading tool…
  • 🔒 Files never leave your device
  • ⚡ Converted in your browser
  • ✅ No account required

JavaScript Minifier: The Complete Guide

Compress your JavaScript with Terser — the industry-standard minifier. Whitespace is removed and (optionally) variable names are shortened to produce the smallest working code.

How to use the JavaScript Minifier

  1. Paste or type your code, text, or data into the input box.
  2. Adjust options such as indent size, dialect, or flags when the tool offers them.
  3. The output updates instantly — copy it to your clipboard or download the file.

Features

  • Powered by the Terser engine
  • Optional name mangling
  • Dead-code & whitespace removal
  • Copy or download the result

Why use this tool

  • Smaller bundles load faster
  • Production-grade optimization
  • No build tooling required

What is a JavaScript minifier?

A JavaScript minifier rewrites your code to be as small as possible without changing what it does — removing whitespace and comments, and optionally shortening local variable names. This tool uses Terser, the same engine used by major build tools, so the output is production-ready.

Frequently Asked Questions

Will minifying break my code?

Terser preserves behavior. If you see an error, your input likely has a syntax issue — the tool reports it so you can fix it.

What does 'shorten variable names' do?

It renames local variables to short names (like a, b, c) for extra savings. Turn it off if you want to keep readable names.

Is it free and private?

Yes — it's 100% free with no signup, and everything runs locally in your browser, so your data is never uploaded to a server.