Does pretty printing JavaScript change behaviour?
No. Outside of strings, JavaScript is whitespace-insensitive. The pretty printer only inserts line breaks and indentation — the parsed AST and runtime behaviour stay identical. Automatic semicolon insertion (ASI) is also preserved because the formatter never removes existing semicolons or rearranges statements.
Can it unminify JavaScript from a production bundle?
Yes. Paste the minified output from webpack, Vite, esbuild, or Terser and the pretty printer restores indentation. Variable and function names that were mangled (one-letter names like a, b, c) cannot be recovered — that requires a sourcemap — but the structure becomes readable.
Does it support ES6+ syntax?
Yes. Arrow functions, template literals (backtick strings), destructuring, async/await, optional chaining (?.), nullish coalescing (??), classes, and private fields (#name) are all formatted correctly. Template literal interpolation is preserved exactly.
Why are template literals preserved exactly?
Backtick template literals can span multiple lines, contain line breaks that matter, and embed expressions via ${}. Reformatting them would change rendered output. The pretty printer detects template literal boundaries and leaves their interior untouched.
Will this fix my JavaScript syntax errors?
No. A pretty printer reformats syntactically valid JavaScript. If your code has a missing brace, unclosed string, or invalid token, run it through a linter (ESLint) or a parser (Acorn, Babel) to surface the error first, then format.
Is the JavaScript I paste sent to your servers?
No. Pretty printing runs entirely in your browser using JavaScript. Code containing API keys, proprietary algorithms, or unreleased features never leaves your device. Open DevTools → Network and click Run to verify no requests are made.
What is the difference between pretty print and beautify?
They are the same operation. Both terms describe inserting consistent indentation, line breaks, and spacing to make code readable. js-beautify and Prettier are the two most popular tools that do this — they call the operation "beautify" and "format" respectively.
How is this different from Prettier?
Prettier is an opinionated formatter that re-prints the entire AST — it normalises quote style, line length, trailing commas, and many other choices. This pretty printer is lighter: it preserves your existing token order and only adds line breaks and indentation. Use this for quick unminification; use Prettier for project-wide enforcement.