Female Tools  ·  JS Minifier

JavaScript Minifier

Remove comments and collapse whitespace from JavaScript. Basic minification — no AST parsing.

This javascript minifier does lightweight, string-aware compression for quick one-off scripts. It walks through your source character by character, correctly tracking string and template literal boundaries so it never mangles code hiding inside quotes, then strips both line and block comments and collapses blank lines and repeated whitespace down to single spaces. Unnecessary spacing around common operators and punctuation is removed as well, and a stats bar reports the byte size before and after along with the percentage saved. It's a fast option for shrinking a small utility script or snippet without setting up Terser, esbuild, or a bundler — but because it does not parse a full syntax tree, it won't rename variables or perform the deeper optimizations a real build tool can, so for production bundles a proper minifier is still recommended.

Basic minifier — removes comments and whitespace only. For production, use Terser or a bundler.
Input JavaScript
Minified JS

How to Use JS Minifier

  1. Paste your JavaScript code into the input panel.
  2. Click "Minify" to strip comments and collapse whitespace.
  3. Check the stats bar for the size before and after, and percentage saved.
  4. Copy the result or click the .js button to download it.

Frequently Asked Questions

Paste your JavaScript, click Minify. The tool removes comments, collapses whitespace, and produces the smallest possible JS string.

Yes, minified JavaScript is functionally identical — only whitespace and comments are removed. All logic, variables, and functions remain intact.