SnappTools logoSnappTools

JavaScript Minifier

Minify JavaScript code by removing comments, whitespace, and newlines.

JavaScript Input
Minified Output

About JavaScript Minifier

JavaScript Minifier compresses your JavaScript by removing whitespace, comments, and shortening variable names where possible — producing smaller files that load faster in browsers. Reduced JS payload size directly improves your Core Web Vitals and page performance scores.

This is especially useful when you're working outside a build tool environment, need to quickly minify a standalone script, or want to check how much a bundler could compress your code.

Paste your JavaScript and see the minified output along with a size comparison showing exactly how many bytes you saved.

Features

  • Removes whitespace, comments, and dead code
  • Shows original vs minified file size
  • Works with ES5, ES6+, and modern JavaScript syntax
  • One-click copy of minified output

Common Use Cases

  • Minifying scripts for deployment without a build tool
  • Compressing inline scripts for HTML email
  • Reducing the size of bookmarklets
  • Checking compression potential before setting up a bundler