JavaScript Minifier
Shrink JS file size with Terser — industry-standard compression
Minified JavaScript will appear here
Paste JavaScript above and click Minify
Advertisement
Free JavaScript Minifier powered by Terser. Minify JS online: remove comments, compress code and compare file size, all in your browser with no upload.
Shrink JS file size with Terser — industry-standard compression
Minified JavaScript will appear here
Paste JavaScript above and click Minify
JavaScript Minifier compresses your code with Terser, the minifier Webpack uses by default. Paste plain JavaScript to remove comments, fold constants and eliminate dead code, then compare the original and minified size and download the result. Top-level names stay unmangled, and JSX must be transformed to plain JavaScript first. Everything runs in your browser, so your source code is never uploaded.
What you get with JavaScript Minifier.
Uses the same minifier Webpack ships by default, for production-grade JavaScript compression.
Simplifies expressions and strips unreachable code in two optimization passes.
See original vs. minified byte count and percentage saved after each run.
Follow these steps to get the best results.
Paste plain JavaScript (ES2022+ is fine; transform JSX to JS first).
Run Terser — comments are removed and code is compressed in two passes.
Check the size reduction, then copy or download the minified script.
Advertisement
Common questions about JavaScript Minifier.
Yes — everything runs in your browser using Terser. Your code is never sent to any server.
No — top-level names are left as-is so the minified output stays easier to debug. This tool focuses on compression (removing comments, whitespace, and dead code) rather than name mangling.
Yes — Terser supports modern JavaScript including ES2022+ syntax. For JSX, transform to plain JS first (e.g., with Babel) before minifying.
Typical savings are 20–40% from comment and whitespace removal alone. Heavily commented, loosely formatted code sees the biggest reductions.
Terser is the open-source JavaScript parser, compressor and mangler that Webpack uses by default and that Vite supports as a minifier option. This JavaScript Minifier runs Terser in your browser, so you can minify a file without installing anything. To use it in a project instead, install it with npm and run: npx terser input.js --compress --mangle --output input.min.js
Advertisement
Comments
Share feedback, ask questions, or help others use this tool.
Join the discussion
Sign in to comment, reply, and report inappropriate content.