JS Minifier
Minify JavaScript code online for free using Terser. Removes whitespace, shortens variable names, eliminates dead code. No signup.
Runs entirely in your browser — files never uploaded
How to use JS Minifier
- 1. Paste your JavaScript. Paste or type your JS code into the input textarea.
- 2. Configure options. Toggle 'Mangle variable names' to shorten local variable names for extra savings.
- 3. Click Minify. The tool uses Terser to compress your code. Copy the result or check the size reduction.
FAQ
Is my code sent to a server?
No. Terser runs entirely in your browser via WebAssembly/JS — nothing is uploaded.
What does 'mangle' do?
Mangling renames local variables to shorter names (e.g., a, b, c). It doesn't rename globals or exported names.
Will minification change my code's behavior?
Terser is semantics-preserving. It removes dead code and shortens names but doesn't alter logic.
What if I get a syntax error?
Terser will report a parse error if your input isn't valid JavaScript. Fix the syntax and try again.
Does it support TypeScript?
No. Terser works with plain JavaScript. Strip types first (e.g., via the TypeScript compiler) before minifying.
Related tools
- Base64 EncoderEncode text or files to Base64 or decode Base64 back online for free. Instant conversion, no signup, runs in your browser.
- JSON FormatterFormat and validate JSON online for free. Beautify with indentation, validate syntax, or minify. Runs in your browser, no signup.
- CSV ↔ JSONConvert CSV to JSON or JSON to CSV online for free. Live preview as you type or upload a file. No signup, runs in browser.
- Timestamp ConverterConvert Unix timestamps to dates and dates to timestamps online for free. Supports seconds, milliseconds, ISO 8601. No signup.
- JWT DecoderDecode JWT tokens online for free. Inspect header, payload, and claims. Verify expiration and signature algorithm. No signup, runs in browser.
- Regex TesterTest regular expressions online for free with live match highlighting, capture groups, and flag toggles. Supports JavaScript regex. No signup.
Advertisement