Skip to content

JavaScript Minifier

Minify JavaScript for production.

  • Free
  • No sign-up
  • No watermark
  • Works in your browser

Also called: JavaScript minifier, minify JS online, JS compressor.

About JavaScript Minifier

Make JavaScript smaller for production. Paste your code and press Minify to remove comments and extra spaces, shorten variable names and simplify expressions. The tool shows how many bytes you saved, and points to the line and column of any syntax error. The work is done in your browser and your code is never uploaded.

How to use JavaScript Minifier

  1. Paste your code, press Open file, or press Sample.
  2. Choose what to do: shorten the code, shorten variable names, keep /*! license */ comments, and treat the code as an ES module if it uses import or export.
  3. Press Minify and check the sizes shown.
  4. Press Copy result or Download.

Tips and good to know

  • Always test the minified file before you publish it. Minifiers are reliable, but code that depends on function names or uses eval can break.
  • Turn off Shorten variable names if you need to read the result or if other code looks up names as text.
  • Keep license comments that begin with /*! when the code is covered by a licence that requires them.
  • This tool reads plain JavaScript. For TypeScript or JSX, compile to JavaScript first.
  • Real savings also come from gzip or brotli on your server, which work well on top of minified code.

Frequently asked questions

Is my code uploaded?

No. Minifying happens in your browser and nothing is sent anywhere.

Will it change how my code works?

It should not. It removes only what has no effect, but keep your original and test the result.

Why do I get a syntax error?

The code may use TypeScript or JSX, or contain a real mistake. The line and column are shown.

What does the ES module option do?

It reads the code in strict mode, which module files always use. Turn it on for files with import or export.

How much smaller will it be?

Often 30% to 60% before compression. The size change is shown after you press Minify.

Is JavaScript Minifier free?

Yes. JavaScript Minifier is free: no sign-up, no paid plan, no trial and no limit on how often you use it. It runs in your browser, and ToolzAura is paid for by ads, so every tool stays free.

Are my files uploaded?

No. This tool runs in your browser, so your input stays on your device.

Maintained by Malik Shaheer · Last reviewed · How we test tools · Report a problem

Related tools

Markdown Editor

Write Markdown and see a live preview.

Developer Tools

Markdown to HTML

Convert Markdown into HTML code.

Developer Tools

Regex Tester

Test regular expressions with live match highlighting.

Developer Tools

SVG Editor

Draw and edit SVG graphics.

Developer Tools

Tailwind CSS Playground

Try Tailwind classes with a live preview.

Developer Tools

Barcode Generator

Make Code 128, EAN and other barcodes.

Developer Tools