JS Minifier

Minify JavaScript (whitespace/comments basic).

Reset

About the JS Minifier

This JS Minifier reduces JavaScript size by stripping comments and unnecessary whitespace. It is aimed at small scripts and paste-in snippets where a full Webpack/esbuild pipeline is overkill — bookmarklets, tiny widgets, or quick demos.

It is a basic compressor, not a full mangler/transpiler. For large apps, prefer a real build tool that also bundles and tree-shakes.

Useful scenarios

  • Compressing a short analytics or UI helper script
  • Preparing a snippet for embedding in a CMS custom HTML block
  • Teaching the difference between readable source and shipped bytes

How to use

  1. Paste JavaScript source into the input.
  2. Minify and verify the output still looks syntactically intact.
  3. Test the script in the browser before deploying.

Important limits

  • Do not rely on this for TypeScript, JSX, or modern bundling — compile first.
  • ASI edge cases and certain regex literals can be sensitive; always run the result.
  • Keep unminified source in git for debugging production issues.

FAQ

Does this rename variables? No. It focuses on whitespace/comments, not aggressive mangling.

Will minifying hide bugs? No — it can only make stack traces harder to read. Use source maps in real apps.