FreeOnlineQR

JavaScript Beautifier

Take minified or badly formatted JavaScript and get indentation back. The hard part of doing this correctly is knowing what is code and what isn't: a brace inside a string, a slash that opens a regular expression rather than dividing, a template literal spanning five lines. Each of those is scanned and copied through untouched here, so the indentation follows the real block structure rather than whatever punctuation happened to appear.

Result

Nothing is uploaded — this tool runs inside your browser, so your files never leave your device.

Help us improve

Why use this tool

  • Indents by real brace and bracket depth, not by counting characters
  • Strings, template literals, regular expressions and comments are preserved exactly
  • Keeps `} else {` and `} catch {` together rather than splitting them
  • Runs in your browser — paste a whole production bundle if you want to read it

How it works

  1. 1Paste the JavaScript you want to read.
  2. 2Choose two spaces, four spaces or tabs.
  3. 3Copy the formatted code into your editor.

JavaScript Beautifier — frequently asked questions

You get the structure back, not the names. A minifier renames local variables to single letters and that is irreversible — no formatter can turn `t` back into `userAccountBalance`. If the site publishes a source map, that will give you the true original; without one, beautified code is the best available.

Explore the other tools

Same deal everywhere on the site — free, no sign-up, and no watermark on anything you download.

Or see every tool on one page.