Uglify JavaScript Online Free — Minify and Shorten Variable Names in Your Browser
Table of Contents
"Uglify" refers to a specific type of JavaScript minification that goes beyond removing whitespace — it also renames local variables to single characters. The result is dramatically smaller, nearly unreadable code that runs identically to the original. UglifyJS was the dominant JavaScript minifier for years before being partially superseded by Terser.
Our free browser minifier performs AST-based JavaScript minification including variable name shortening — the same technique as UglifyJS/Terser — without any npm install.
What Variable Name Shortening (Uglification) Does
Consider this JavaScript function:
function calculateTotalPrice(itemPrice, quantity, taxRate) { return itemPrice * quantity * (1 + taxRate); }
After uglification (AST-based minification with variable shortening):
function calculateTotalPrice(e,t,r){return e*t*(1+r)}
The function name is preserved (it's exported/public). But the parameter names — which are only used inside the function — are shortened to single letters. The code runs identically.
For a large application with thousands of local variables, this can reduce JavaScript file size by an additional 10-20% beyond basic whitespace removal.
What Names Get Shortened and What Stays the Same
The AST-based minifier is smart about what it renames:
- Local variables — renamed to single letters (a, b, c...)
- Function parameters — renamed to single letters
- Private/local function names — shortened if only used internally
What the minifier keeps the same:
- Exported/public names — module exports, globally accessible functions and variables
- String literals — the content of strings is not modified
- Property names —
obj.propertyNameis not shortened (would break external APIs) - Class names — not shortened by default
Uglification vs Code Obfuscation — Important Difference
Uglification (which this tool does) makes code smaller and less readable as a side effect of optimization.
Obfuscation deliberately makes code hard to reverse-engineer by transforming logic — adding dummy code, encoding strings, mangling control flow. This tool does NOT obfuscate code.
If you want to protect intellectual property in client-side JavaScript, be aware that both uglification and obfuscation can be reverse-engineered with enough effort — all client-side JavaScript is ultimately accessible to the browser and therefore to anyone determined to read it. No browser-based JavaScript is truly secure from a motivated reverse engineer.
Debugging Uglified Code — Source Maps
Once code is uglified, debugging is harder because variable names are single letters and there are no readable line numbers. The solution: source maps.
A source map is a file that maps uglified code back to the original. When you uglify with a build tool (Terser, webpack), you can generate a source map alongside the minified file. Browser DevTools use the source map to show you original variable names and line numbers in the debugger.
The browser minifier tool does NOT generate source maps — it's for quick, one-off minification. For projects where you need source maps, use Terser CLI or a build tool.
Uglify JavaScript Now — Free, No npm
AST-based minification with variable shortening. Runs entirely in your browser.
Open Free Code MinifierFrequently Asked Questions
Is "uglify" the same as "terser"?
Terser is the successor to UglifyJS. It supports ES2015+ syntax (UglifyJS did not). Both perform the same kind of AST-based minification with variable shortening. Our tool uses an AST minifier compatible with modern JavaScript.
Can I uglify code that uses eval()?
Code containing eval() cannot have its variable names safely shortened — eval can construct code that references those variables by name. The minifier handles this conservatively and will not shorten variables that could be accessed via eval.
What is the difference between minified and uglified file sizes?
Minification (whitespace only) typically reduces file size by 30-50%. Uglification (whitespace + variable renaming + dead code removal) typically reaches 50-70% reduction on real-world application code.

