Use the JavaScript Minifier & Beautifier
Minify JavaScript by safely removing comments and unnecessary whitespace, or beautify minified/compressed JS back into readable, indented code.
- Free to use
- No signup
- Nothing to install
- Runs in your browser
function add(a,b){\n // sum two numbers\n return a + b;\n}\n -> minified: function add(a,b){return a+b;}
Open the JavaScript Minifier & Beautifier
Illustration. Open the tool for the real thing.
What is the JavaScript Minifier & Beautifier?
Minify mode shrinks your JavaScript by removing <code>//</code> line comments and <code>/* */</code> block comments and collapsing unnecessary whitespace and blank lines — safely, using a real tokenizer that understands strings, template literals and regular expression literals, so a <code>//</code> inside a string or URL is never mistaken for a comment and stripped by accident. This is an honest whitespace-and-comment minifier: it does not rename variables or restructure logic the way a build-tool minifier like Terser does, so the output behaves identically to the input, just smaller.
Beautify mode does the reverse: paste dense, minified or poorly formatted JavaScript and get it re-indented with consistent spacing around braces, so you can actually read and debug it — useful when inspecting a third-party script or a minified file you need to understand.
3 steps to your result
Open the tool and follow along. Nothing to install.
What you get
Correctly skips strings, template literals and regex literals so comment-stripping never corrupts code.
Removes comments and whitespace only — never renames variables or changes logic.
Re-indent minified or messy JS to read it properly.
Shows before/after byte size and percentage reduction.
AZRS tools are free to open and use.
It opens in your browser, so there is nothing to download.
Used for
Pick one to see how it fits.
Developers shipping a small script
Shrink a standalone JS file without setting up a full build pipeline.
Try it freeAnyone debugging a minified third-party script
Beautify it first to actually read the logic.
Try it freeStudents learning JavaScript
See exactly what comment/whitespace removal does to real code.
Try it freeHow it compares
A plain look at this tool next to the usual alternative.
| This utility | Desktop software | |
|---|---|---|
| Install | Nothing to install | Usually an app or program to install |
| Account | No signup | Depends on the product |
| Cost | Free to use | Free or paid, depends on the product |
| Where it runs | In your browser tab | On your computer |
Questions people ask
Does this rename variables like Terser or UglifyJS?
No — this is an honest comment-and-whitespace minifier only. It shrinks file size safely without changing any identifier names or program logic.
Is it safe to strip comments containing URLs or code samples?
Yes — the tokenizer tracks string and template literal boundaries, so text that looks like a comment marker inside a string is never touched.
Can it minify JSX or TypeScript?
It's designed for plain JavaScript; JSX/TypeScript-specific syntax may not tokenize correctly since those require a language-aware parser.
Why would I beautify code instead of just reading it minified?
Minified code has no line breaks or indentation, making control flow nearly impossible to follow visually — beautifying restores readable structure.
Is my code uploaded anywhere?
No, everything runs locally in your browser.
More free tools
Related to the JavaScript Minifier & Beautifier.
Try the JavaScript Minifier & Beautifier now
Strip comments and excess whitespace from JavaScript, or re-indent minified code to read. Free to use.
Try it free