JavaScript minifier

Removes comments, indentation and blank lines without touching your code's structure. Strings and template literals are parsed and left exactly as they are.

  • String-aware
  • No renaming
  • Download or copy
Original0 B
Minified0 B
Saved0 B
Reduction0%
Nothing to minify yet
Good to know

What this JavaScript minifier does

1

What it removes

Line and block comments, indentation and blank lines. Statements, names and semicolons stay as they are, so the output is still readable and easy to debug.

2

What it won't do

It doesn't rename variables, remove dead code or tree-shake. For that, run esbuild or Terser as part of a build.

3

Strings are safe

The input is scanned character by character, so a // or /* inside a string or template literal is never mistaken for a comment.

4

Regex literals

A comment-like sequence inside a regular expression can still trip up a simple scanner. Check the output before you deploy anything unusual.