JavaScript Minifier
Compress a script with Terser, the minifier behind most production bundles: whitespace and comments removed, variable names shortened, constants folded and dead code dropped. The byte count before and after is shown, and nothing leaves your browser.
0 B
—
🔒 Runs in your browser — nothing is uploaded. Formatting uses Prettier, minifying uses Terser; both load from the jsDelivr CDN on first use.
Share:
What Terser changes
| Input | Output | Technique |
|---|---|---|
| function add(first, second) { return first + second; } | function add(n,t){return n+t} | mangling local names |
| const DEBUG = false; if (DEBUG) log(); | (removed) | dead-code elimination |
| x = x + 1; return true; | return x++,!0 | compression of expressions |
| obj.property | obj.property | property names are never renamed |
Readable again: JavaScript formatter. Stylesheets: CSS minifier. Data: JSON formatter.
Frequently asked questions
Cite this calculator
APA
CalcBrew. (2026). JavaScript Minifier. https://calcbrew.com/javascript-minifierMLA
“JavaScript Minifier.” CalcBrew, 2026, calcbrew.com/javascript-minifier.Link to https://calcbrew.com/javascript-minifier. Results are estimates; cite the underlying formula or data source for academic work.
Related tools
JSON Formatter, Validator & Minifier OnlineFree JSON formatter: pretty-print JSON with 2 or 4 spaces or tabs, validate it with the exact error line and…URL Encoder & DecoderFree URL encoder and decoder: percent-encode text for query strings (encodeURIComponent) or whole URLs…UUID GeneratorFree UUID generator: create one or hundreds of version 4 (random) or version 7 (time-ordered) UUIDs/GUIDs…XML Formatter & BeautifierFree online XML formatter: pretty-print messy XML with 2 or 4 spaces or tabs, validate it and see the exact…Base64 Encode & Decode OnlineFree Base64 encoder and decoder: convert text to Base64 and Base64 back to text (UTF-8 safe), URL-safe…CSS Formatter & BeautifierFree CSS formatter: beautify minified or messy CSS with consistent indentation (2 or 4 spaces, tabs), one…
More in Developer Tools · All tools & games