Runs 100% in your browser — nothing is uploaded
Formatters & Minifiers

JavaScript Beautifier

Beautify minified or unformatted JavaScript with configurable indentation and spacing — live, in your browser.

JavaScript Beautifier
Client-side

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.

FAQ

Is this the same as running Prettier?
No — this tool uses js-beautify, not Prettier. Both reformat JavaScript, but their opinions on formatting details (quote style, trailing commas, brace placement) differ. js-beautify is particularly good at un-minifying already-compressed code, which is its primary use case here.
Can it fix minified code from a bundler?
Yes — this is the tool's core use case. Minified/bundled JavaScript has no meaningful whitespace, so beautifying it recovers a readable line-per-statement structure, even though original variable names (if they were mangled) cannot be restored.
What does "space before function paren" control?
It toggles between function foo() {...} (no space, common in many style guides) and function foo () {...} (space before the parenthesis, used in some style guides).
Does formatting change how the code behaves?
No. Only whitespace, indentation, and line breaks are changed. The abstract syntax tree — and therefore runtime behavior — is identical before and after formatting.
Is my code sent anywhere when I use this tool?
No. js-beautify runs entirely in JavaScript inside your browser tab. Open your Network panel while formatting to confirm — there are zero outbound requests for the formatting operation itself.