Step 01 — JavaScript
Minify JavaScript with UglifyJS 3
Paste your code, drag a file in or pick one. Parsing and compression run in your browser — nothing is sent to a server. The gauge below shows how many bytes you save on every run.
Loading engine…
Source
0 BMinified
UglifyJS options
UglifyJS 3 targets ES5. If you hit a parse error on modern syntax such as arrow functions, classes or let, run the code through Babel first or use Terser for ES2015+.
How it works
A small file in three steps
1 · Provide the code
Paste from the clipboard, drag a .js file onto the left pane or open one with “Choose file”. Minifying files one by one and concatenating afterwards is safer than feeding everything at once.
2 · Tune the options
The default compress + mangle is the right balance for most projects. If you publish a library, leave toplevel off so your exported names survive.
3 · Grab the output
Copy it or download it as .min.js. The gauge shows the remaining size relative to the source and the real size that travels over the network after gzip.
Reference
What does each option do?
| Option | Effect | When to turn it off |
|---|---|---|
compress | Removes unreachable code, simplifies conditions, folds constants. | Only when you just want whitespace stripped. |
mangle | Shortens local variable and parameter names to single letters. | If code inspects names via Function.prototype.toString. |
toplevel | Also shortens names at the module top level. | In classic scripts that expose globals. |
keep_fnames | Leaves function names untouched. | Keep it off unless you need readable stack traces. |
drop_console | Removes every console.* call. | If your production code logs on purpose. |
passes | Runs the compressor several times for a few extra bytes. | Multiplies the time on big files; 1 is usually enough. |
Frequently asked
FAQ
Is my code sent to a server?
No. UglifyJS 3 is downloaded into your browser and minification runs inside a Web Worker on your device. Your code never goes over the network and is never stored.
Does UglifyJS 3 support modern syntax?
UglifyJS 3 focuses on ES5. Files with arrow functions, classes or async/await can fail to parse. Compile with Babel first, or switch to Terser, maintained by the same team for ES2015+.
What is the difference between mangle and compress?
Compress rewrites the structure: it drops dead code and shortens expressions. Mangle only renames. The biggest win comes from both together, but compress gains survive gzip better.
Can I un-minify the output?
No. Comments and original names are lost for good. You can re-format the output with “Beautify output”, but you will never get the original source back — always keep it separately.
Why is my output bigger than expected?
The file may contain long strings, base64 data or many license comments. Set comments to “None” and check the gzip row: the size that actually travels over the network is usually much smaller than you think.
CSS is nextShrink your stylesheets on the same site: level 2 optimization with clean-css 5, rule merging and legacy-browser compatibility.
Go to the CSS Minifier →