JavaScript Minifier
Real minification with Terser — compress + mangle, in your browser
Input JavaScript
Minified
Original
Minified
Saved
JavaScript Minifier — Complete Guide & Instructions
MakeCard JavaScript Minifier runs the real Terser engine — the same compressor used by webpack — directly in your browser. It strips comments and whitespace, applies safe compression passes and mangles local variable names, then reports original size, minified size and percentage saved. It is built for developers who want production-grade minification without sending proprietary code to a remote API.
How to Use JavaScript Minifier
- 1 Paste your code into the “Input JavaScript” box, or click “Load sample” to try it first.
- 2 Press the “Minify” button — large files show a “Minifying…” state briefly.
- 3 Read the Minified output on the right panel.
- 4 Check the stat row: Original chars, Minified chars and Saved %.
- 5 Click “Copy” to grab the minified code for your build or script tag.
Key Features & Capabilities
- Powered by Terser — genuine compress + mangle passes, not just whitespace removal.
- Variable and function name mangling shrinks identifiers safely within scope.
- Live stats showing original size, minified size and percent saved.
- One-click sample code for testing, and one-click copy of the output.
- Clear error reporting when the input has syntax problems.
Supported Formats & Specifications
| Parameter | Specification |
|---|---|
| Engine | Terser — compress and mangle enabled |
| Input | Any standard JavaScript (ES5+); sample loader included |
| Output | Single-line minified code, copyable |
| Stats | Original chars, minified chars, % saved |
| Processing | In-browser — code never leaves the tab |
Practical Everyday Use Cases
- Shrinking a script before embedding it in a website or email template.
- Checking how much minification will save before adding a build step.
- Producing a one-line snippet for browser bookmarklets.
- Obfuscating casual readability of client-side utilities with name mangling.
- Verifying that code survives aggressive compression in a quick test.
Pro Tips for Best Results
- Minification is not obfuscation — mangled names deter casual reading but determined users can still reformat the code.
- Keep a readable source copy; minified output is effectively one-way.
- If the output breaks, look for reliance on function.name or implicit globals — mangling renames local identifiers.
- Run minification after transpiling for old browsers, not before.
Common Problems & Solutions
The input has a syntax error or uses unsupported syntax. Fix the reported line first — the parser must succeed before compression runs.
Rare, but code depending on function.toString(), eval() scopes or Function constructor names can misbehave under mangling — disable those patterns.
Already-terse code or mostly-string content compresses little; comments-heavy code saves the most.
Privacy & Security
100% Client-Side Execution
Minification executes locally in your browser — your JavaScript source is never uploaded, logged or stored.
Frequently Asked Questions
Everything you need to know about using JavaScript Minifier
It removes comments, whitespace and dead code, renames local variables to short identifiers, and folds expressions — producing functionally identical but much smaller code that loads faster.
Terser is the maintained successor to UglifyJS with full ES6+ support; it is the default minifier in webpack 5 and handles modern syntax Uglify cannot.
Typical savings are 40–70% depending on comments and identifier length — the tool shows the exact Saved % after each run.
No — mangling obscures names but anyone can reformat the output. Never store secrets or API keys in client-side code, minified or not.
Related FreeToolsBazaar Tools
Ready to Use JavaScript Minifier?
100% free, browser-based, and private. No installation, registration, or file upload to external servers required.
Start Using JavaScript Minifier