JavaScript Minifier / Beautifier
Minify or beautify JavaScript in your browser, with a tokenizer that respects strings, regex and comments.
Related tools
All JSON, XML & formats tools →JavaScript Minifier / Beautifier is free to use as often as you like, directly from this page. You will find it under JSON, XML & formats, with CSS Beautifier and HTML Beautifier for the neighbouring cases.
How to use it
- Open the tool — no signup or install needed.
- Enter your input or adjust the available options.
- Get your result instantly, then copy or download it.
Frequently asked questions
What is JavaScript Minifier / Beautifier?
Minify or beautify JavaScript in your browser, with a tokenizer that respects strings, regex and comments.
When would I actually use this?
Making a machine-generated blob readable, finding the character where a parse fails, and shrinking a file before it ships.
What is the most common mistake?
Assuming valid means correct. A document can parse cleanly and still have the wrong shape for whatever will read it — validation checks the syntax, not the schema.
How is JavaScript Minifier / Beautifier different from CSS Beautifier?
They sit next to each other but answer different questions: CSS Beautifier is the one to open when you need it to reformat minified or messy CSS into clean, properly indented rules — or minify it back. Pick whichever matches what you're starting from — both are free.
Is there a tool for the next step?
HTML Beautifier is the closest one after this: Turn minified or tangled HTML into cleanly indented, readable markup — or minify it.
What else is worth having open alongside it?
CSS minifier and Is JavaScript enabled? — they come up in the same task often enough to be worth a second tab.
Where do the figures come from?
Parsing and serialisation follow each format's specification. Key order and whitespace are not semantically meaningful in JSON or YAML, so a reformatted document is equivalent even when the bytes differ.