JavaScript Minifier
Shrink JavaScript for production. Paste modern JavaScript (ES2024, modules) and minify it with Terser — the same engine used by webpack, Vite and Next.js — with options to shorten variable names and remove console statements, keeping licence comments.
Paste your code and click Minify. Terser parses it, removes whitespace and comments, compresses expressions over two passes and (optionally) renames local variables. Syntax errors are shown with the line and column. The result and size saving appear instantly; nothing leaves your browser.
Zero Server Uploads
Files process in local RAM
Instant WASM Speed
No waiting queues or lags
Unlimited Batching
Convert files without limits
Suggest a Feature or Improvement for JavaScript Minifier
Need custom options, higher limits, or extra format support? Let our engineering team know!
How to use JavaScript Minifier
- 1Paste your JavaScript.
- 2Choose whether to mangle names or drop console calls.
- 3Click Minify JavaScript.
- 4Copy or download the .min.js file.
What minification does
Minifiers remove whitespace and comments, shorten local variable and function names, and rewrite code into shorter equivalents (dead-code removal, constant folding). Typical savings are 30–60% before gzip or Brotli compression, which your server should also apply.
Minified code behaves identically. It isn't protection: anyone can reformat it with the JavaScript Beautifier.
Build tools do this for you
If you use a bundler (Vite, webpack, esbuild, Next.js), minification happens automatically in production builds. This tool is handy for standalone scripts, snippets, bookmarklets and checking how small code can get. Minify styles with the CSS Minifier.
Frequently Asked Questions
Does it support TypeScript or JSX?
No — Terser works on plain JavaScript. Compile TypeScript/JSX first.
Will minifying break my code?
Terser is used by millions of builds and is very safe. Code relying on function.name or eval of local names can be affected by mangling — turn it off if so.
Is my code or data uploaded?
No. Everything runs in your browser; nothing you paste is sent to a server or stored.