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.

Formatted JavaScript

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.

Everything runs locally in your browser via WebAssembly — your code is never uploaded.

Handy for

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=space

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.