Skip to content
snip tools

JavaScript minifier

Compress JavaScript with Terser to reduce file size. Runs entirely in your browser.

Runs 100% in your browser
 

How to minify JavaScript

  1. Paste your JavaScript. Paste the code you want to minify.
  2. Minify. The compressed output and size saved appear instantly.
  3. Copy or download. Grab the result with Copy or Download.

About JavaScript minification

Minification shrinks JavaScript so it downloads and parses faster — a direct win for page speed. Terser, the industry-standard minifier, strips comments and whitespace, renames local variables to single characters and removes unreachable code, all while preserving behaviour. Bundlers do this automatically in production; this tool is handy for quick one-off files, snippets or learning what minified output looks like.

Frequently asked questions

What does the JavaScript minifier do?
It uses Terser to remove whitespace and comments, shorten local variable names, drop dead code and apply other safe compressions — producing functionally identical but much smaller JavaScript.
Does it support modern JavaScript?
Yes. Terser parses modern ECMAScript (ES2020+), including arrow functions, classes, optional chaining and modules.
Will minifying break my code?
Terser preserves behaviour for valid input. If your code relies on function or variable names at runtime (e.g. some reflection), review the output. Syntax errors in the input are reported.
Is my code uploaded anywhere?
No. Terser runs entirely in your browser; your source never leaves your device.