JavaScript Beautifier
Beautify minified or unformatted JavaScript with configurable indentation and spacing — live, in your browser.
About this tool
The JavaScript Beautifier reformats minified, bundled, or inconsistently styled JavaScript into clean, readable, properly indented code. Paste a minified vendor bundle, a one-liner from a build tool, or code copied from a chat message with all its formatting stripped, and get back code you can actually read line-by-line.
This tool is built on js-beautify's js_beautify engine, the same formatter used by browser DevTools' "pretty print" feature and many IDE extensions. Formatting updates live as you type, with a 300ms debounce so it doesn't fight you mid-keystroke. You control indent size (2 spaces, 4 spaces, or tabs), whether a space is inserted before function parentheses (function foo () vs function foo()), and whether array literals keep their original line breaks instead of being collapsed.
Everything runs client-side using js-beautify loaded directly in your browser tab — no code is ever transmitted to a server. This matters when the snippet you're formatting is proprietary, unreleased, or simply not something you want passing through a third party's infrastructure. Character counts before and after are shown so you can see exactly how much the formatting expanded the source.
Typical uses: reverse-engineering a minified third-party script to understand what it does, cleaning up code pasted from Slack or a PDF that lost its whitespace, or quickly reformatting a snippet before pasting it into a code review comment. For the reverse operation — compressing readable JS into a small production bundle — use the JavaScript Minifier tool, which uses terser for real compression and variable mangling.
