⚡ Developer · Client-side · No data sent to server

JavaScript Minifier

Paste JavaScript to strip comments and collapse whitespace. It keeps your identifiers, strings, template literals, and regex intact, and runs entirely in your browser.

Input
Minified output
Waiting for input… ✓ Copied!
Basic minification. This tool removes comments and collapses whitespace only. It does not rename or mangle identifiers, so the output stays readable and behaves the same. It scans your code so strings, template literals, and regex stay untouched. Everything runs in your browser; nothing is uploaded.

About the JavaScript Minifier

The JavaScript Minifier strips comments and collapses unnecessary whitespace to make your JS files smaller, without renaming or mangling anything. It is built for WordPress and Divi developers, theme and plugin authors, and anyone who wants a quick size cut without a build step. The output keeps your original identifiers, so it stays readable and behaves the same as the source. Everything runs in your browser, so your code is never uploaded.

How it works

  1. Paste or type your JavaScript into the input area.
  2. Click Minify, or just edit the input to see the result update.
  3. Read the status bar to compare the original size, the minified size, and the percent saved.
  4. Click Copy to grab the minified output.

Features

  • Removes line comments and block comments.
  • Collapses blank lines and extra spaces while keeping the code valid.
  • Leaves identifiers, strings, template literals, and regex literals untouched.
  • Shows original size, minified size, and percent saved.
  • Runs fully client-side with one-click copy and no external libraries.

Frequently asked questions

Does this rename variables or functions?

No. This is basic minification. It removes comments and whitespace only and never renames or mangles identifiers. Your variable, function, and class names stay exactly as you wrote them, so the output is still readable.

Will it break my strings, template literals, or regex?

No. The tool scans your code and treats strings, template literals, and regex literals as whole units, so their contents are copied through unchanged. Whitespace is only collapsed in the code around them.

How much smaller will my file get?

It depends on how many comments and how much spacing your file has. Heavily commented and indented code shrinks more. The status bar shows the exact original size, minified size, and percent saved for your input.

Is my code uploaded anywhere?

No. All processing happens in your browser. Your code is not sent to a server or logged, and once the page has loaded the tool keeps working without a connection.

Should I use this for production builds?

It is good for quick size cuts and one-off files. For full production builds where you want the smallest possible output, use a tool that also mangles names and performs deeper optimizations, such as Terser, as part of your build pipeline.