Skip to content
Utilerio

JavaScript Minifier

Minify JavaScript to reduce file size, using the same engine as production build tools.

Output

The result will appear here.

Was this tool useful?

About this tool

Minifying JavaScript strips everything a parser doesn't need — comments, whitespace, redundant syntax — without changing what the code does. It matters most for anything shipped to a browser: every byte downloaded before the page becomes interactive.

This tool runs Terser, the minifier behind most production JavaScript bundlers, entirely in your browser via WebAssembly-free pure JS — so it applies the same real optimizations a build tool would, not a naive regex-based whitespace stripper.

How to use it

  1. Paste JavaScript — a single function, a whole file, or a bundle.
  2. Press Minify. Variable and function names are left untouched (this is size reduction, not obfuscation), so the output stays debuggable if you ever need to read it.
  3. Copy the result or check the before/after size in the stats line.

Examples

A small function

function add(a, b) {
  // returns the sum
  return a + b;
}
function add(a,b){return a+b}

Common problems

Minifying reports a syntax error on code that runs fine in my browser.
Terser parses standard ECMAScript; framework-specific syntax (JSX, TypeScript types) needs to be compiled to plain JavaScript first — paste the compiled output, not the source file.

Frequently asked questions