JavaScript Beautifier
Turn minified or obfuscated JavaScript back into clean, readable code — one statement per line, with the indentation you choose. Strings, regex and comments are preserved. Runs in your browser; nothing is uploaded.
About this tool
JavaScript Beautifier re-indents and pretty-prints minified, packed or obfuscated JavaScript into clean, readable source — without changing what the code does.
- One statement per line and properly indented nested blocks, objects and arrays, so you can actually read packed or minified JS.
- Indent sets the spaces per nesting level (1–8). Default is 2.
- Safe by design: strings, template literals, regular expressions and comments are emitted verbatim. Only whitespace and line breaks change, so the output is semantically identical to the input — nothing is reordered or dropped.
Everything runs locally in your browser via WebAssembly — your code is never uploaded.
Handy for
- Reading a minified
bundle.jsor vendor script to understand what it does. - Inspecting obfuscated or packed snippets pasted from the wild.
- Cleaning up hand-written JS that lost its formatting.
FAQ
Can beautifying break my JavaScript?
No. The formatter tokenizes the source and emits strings, template literals, regex literals, and comments byte-for-byte verbatim — only whitespace and line breaks are changed. Nothing is renamed, reordered, or dropped, so the output is semantically identical to the input.
Can I indent with tabs instead of spaces?
Yes — set the indent character to tab and each nesting level becomes one tab.
With spaces (the default), the indent width is configurable from 1 to 8 spaces
per level (default 2); values outside that range are clamped.
Will it rename obfuscated variables back to readable names?
No — this is a formatter, not a deobfuscator. Single-letter or mangled identifiers stay exactly as they are; what you get is proper line breaks and indentation so the structure becomes readable. Recovering meaningful names requires source maps or manual analysis.
Is the code I paste sent to a server?
No. Formatting runs entirely in your browser via WebAssembly, so proprietary or sensitive scripts never leave your machine. The same formatter is available from the gizza CLI and in chat.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool js-beautify "function f(){return a?1:2}"New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/js-beautify/?code=function%20f%28%29%7Breturn%20a%3F1%3A2%7D&indent=2&indent_char=spaceMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
