Errors show the line
If the code cannot be read, the message gives the line and column of the problem so you can fix it in your source.
Minify JavaScript with Terser: remove whitespace and comments, shorten variable names and drop unreachable code. Free and private.
Paste modern JavaScript, including arrow functions, classes and async code.
Choose whether local names are shortened, keep license comments, and tick ES module when the code uses import or export.
Select “Minify JavaScript”, then copy the code or download it as script.min.js.
If the code cannot be read, the message gives the line and column of the problem so you can fix it in your source.
In a regular script, top-level functions and variables keep their names so other scripts on the page can still call them.
Minified code is harder to read but anyone can reformat it. Never rely on it to hide API keys or other secrets.
Minification changes the source representation by shortening code where possible. Gzip compresses the response bytes during transfer and is reversed by the browser. A website can use both; this tool produces minified JavaScript, not a gzip archive.
It allows import and export statements, applies strict mode and lets the minifier also shorten top-level names, which is safe inside a module.
No. Compile TypeScript or JSX to JavaScript first, then minify the compiled output.
It should for standard code. Code that reads function or class names at runtime can break when names are shortened, so turn off “Shorten names” in that case.