JavaScript Beautifier
Turn minified JavaScript into readable code. Powered by js-beautify. Live output, all options.
How to use
Paste minified or compact JavaScript into the input pane. The beautified output appears on the right as you type (300ms debounce).
Adjust indent size, blank-line handling, and formatting options. Copy the output or download as beautified.js.
Keyboard shortcuts
Two shortcuts:
| Cmd / Ctrl + K | Focus the input pane |
| Cmd / Ctrl + Enter | Copy output to clipboard |
When to use it
Beautifying (also called unminifying or prettifying) makes minified code readable — for inspection, debugging, or understanding third-party scripts.
- Reading a minified script embedded in a page's HTML.
- Inspecting a vendor bundle before you rewrite or replace it.
- Making a stack trace pointing into minified code more navigable.
- Cleaning up a one-liner someone pasted into a Slack thread.
Note: Beautifying is not the same as un-mangling. If the original variable names were renamed to a, b, c, this tool doesn't recover them — it only restores formatting. For name recovery, you need source maps.
Options
Indent — 2 spaces, 4 spaces, or a tab character.
Preserve blank lines — keep empty lines from the input in the output. Off: collapse everything to single-line separators.
Max blank — cap on consecutive blank lines when Preserve blank lines is on.
Space in parens — ( x ) instead of (x). Some style guides prefer this.
Break chained methods — put each .method() in a chain on its own line. Useful for fluent APIs.
Trailing newline — end the file with a newline (POSIX convention).
Format-specific gotchas
Mangled names don't come back. Beautifying restores whitespace and line breaks but does not rename a, b, c back to their originals. That information is gone unless you have source maps.
Not all minified code beautifies cleanly. Aggressively-compressed constructs (comma expressions, inlined helpers, mangled property accesses) may produce output that's less readable than you'd hope.
Semicolon-less input is fine. The beautifier handles ASI (automatic semicolon insertion) — you don't need to add semicolons before pasting.
js-beautify is dynamic-imported. First beautify has a brief delay while the library loads. Subsequent runs are instant.
Privacy
Everything runs in your browser. Your JavaScript never leaves the page — no server, no logging, no analytics on the content.