JavaScript obfuscator / minifier / beautifier
Obfuscate, minify, or beautify JavaScript code
Paste any JavaScript — a function, a module, or a full bundled file.
This tool runs entirely in your browser. Your code is never uploaded or sent to a server.
About this tool
JavaScript minification removes whitespace, comments, and renames local variables to shorter names, reducing file size without changing behavior. Obfuscation goes further — it transforms the code to be intentionally difficult to read and reverse-engineer, which provides a degree of protection for client-side logic. The beautifier formats compressed or minified JavaScript into readable code with proper indentation, useful when inspecting third-party scripts or debugging bundler output.
Common uses
- › Minifying scripts before deploying to production
- › Obfuscating client-side logic to discourage casual copying
- › Reducing JavaScript payload to improve page load times
- › Beautifying minified or bundled scripts for debugging
- › Inspecting third-party or vendored JavaScript files
Example
function greet(name) {
return "Hello, " + name + "!";
}
function greet(n){return"Hello, "+n+"!"}
Technical notes
- › Obfuscation is not encryption — determined users can still deobfuscate and read the underlying logic, so never rely on it to protect secrets, API keys, or credentials.
- › Renaming local variables is safe, but be cautious obfuscating code that relies on function.name, reflection, or dynamic property access by string, since those can break.
- › Minifying does not change behavior; if minified output behaves differently from the source, the original code likely relied on automatic semicolon insertion or another parsing edge case.
FAQ
Is obfuscated JavaScript secure?
No. Obfuscation makes code harder to read but not impossible — it deters casual copying, not a determined reverse-engineer. Never put secrets like API keys in client-side code, obfuscated or not.
What's the difference between minifying and obfuscating?
Minifying only removes whitespace and shortens variable names to reduce file size with no intent to hide logic. Obfuscating goes further restructuring the code to make it deliberately hard to follow.
Can I un-minify code with the Beautify option?
Yes — Beautify reformats minified or obfuscated code with indentation and line breaks, though heavily obfuscated variable names will still be unreadable since the original names aren't recoverable.