JavaScript Beautifier

Turn minified JavaScript into readable code. Powered by js-beautify. Live output, all options.

Beautification in your browser. Paste minified JavaScript, get a readable version. Nothing sent to a server. How to use ↓·Shortcuts ↓
Paste minified or compact JavaScript, get a readable version.
Indent:Max blank:
Samples:
Minified Input
Beautified Output
Beautified output will appear here.
Input: 0 bytes · 0 linesOutput: 0 bytes · 0 lines

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 + KFocus the input pane
Cmd / Ctrl + EnterCopy 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.

Frequently asked questions

What is JavaScript beautification?
Reformatting compact or minified JavaScript into a readable form: line breaks, consistent indentation, spacing around operators and keywords. It preserves behavior — the beautified script runs identically.
Can beautification recover original variable names?
No. Beautifying restores whitespace and structure, not identifiers. If names were mangled to a, b, c, they stay that way. Name recovery requires source maps.
Will this modify my code?
Only formatting: whitespace, indentation, and line breaks. Logic, identifiers, and values are untouched. The beautified script runs the same as the input.
Why does the first beautify take a moment?
js-beautify is loaded on demand — the first run triggers the download. After that, beautification is instant.
Does it handle JSX or TypeScript?
js-beautify is JavaScript-focused. It may work on simple JSX or TypeScript but will not reliably handle types, generics, or JSX attributes. Use a language-specific formatter (Prettier) for those.
What is the difference between beautify and minify?
Minify reduces code to the smallest form that still runs. Beautify does the opposite: reformats for readability. Both preserve behavior.