JavaScript Minifier

Reduce JavaScript size by stripping comments and unnecessary whitespace and shortening names where Terser can. Minification loads Terser on demand and stays in your browser.

Result

Paste code, then Minify. Libraries load in your browser.

How to minify JavaScript

  1. Paste valid JavaScript.
  2. Click Minify (Terser loads the first time you run it).
  3. Copy or download the compressed .js output.
  4. Syntax errors stop minify and show a parser message when Terser reports a location.

FAQ

The formatter pretty-prints for reading. This page compresses code for smaller payloads. Invalid JavaScript fails minify instead of guessing.
No. Terser is loaded only when you minify. Formatter-only pages do not download it.
No. Source maps are ignored. Output is minified text you can copy or download as a .js file.
No. Minify runs locally. Treat pasted secrets as untrusted in any browser tab, but DevTilt does not send the input to a server.
Terser requires valid JavaScript. TypeScript-only syntax, missing brackets, or JSON pasted into the minifier will fail. Use the formatter or your editor to locate the parse error line when Terser reports a position.

Related tools