JavaScript Minifier

Free JS minifier: compress JavaScript by removing comments, spaces and line breaks, and see the size saving. Variable names stay readable for debugging.

  • 100% free
  • No sign-up
  • Runs in your browser
or drag & drop files here (.js, .mjs, .cjs, .jsx) — several files are joined in order. Read in your browser, never uploaded.
Minified JS
Paste, upload or load JS code to minify...

Only comments and spaces that cannot change the result are removed; text inside strings, templates and regular expressions is kept exactly. Licence comments (/*! … */) are kept. Variable names are not shortened, so the code stays readable in error messages.

Webmaster Tools

About the JavaScript Minifier

The JavaScript Minifier makes scripts smaller by removing comments, line breaks and spaces. The code runs the same, but downloads faster.

It does not rename your variables, so error messages stay readable when you debug. Licence comments marked /*! … */ are kept. Paste code or upload a .js file. Everything runs in your browser, so your text or code never leaves your device.

How to use this tool

  1. 1Paste your JavaScript, or upload a .js file.
  2. 2Copy or download the minified code.
  3. 3Test your page after replacing the file.

Best-practice tips

  • Keep your original file for editing.
  • For bigger savings, build tools can also shorten variable names; this minifier keeps them for safety.
  • The fastest script is the one you do not load: remove scripts you no longer need.

Faster JavaScript

  • Load scripts with defer or async so they do not block the page from showing.
  • Remove unused plugins and tracking tags.
  • Minify and compress what is left.

See which scripts slow your page with the Website Speed Test.

Answers

JavaScript Minifier FAQs

A tool that removes comments, spaces and line breaks from JavaScript so files download faster.

Related tools

Continue with these related webmaster tools.