What does a JS beautifier actually do?
It re-inserts the whitespace a minifier removed: line break after every semicolon, line break and indent after every opening brace, dedent and line break before every closing brace. The semantics of the code are unchanged — only formatting is altered. The result is the same JavaScript a human would have written.
Can it un-minify a webpack or rollup bundle?
Yes for formatting. The beautifier restores indentation and line breaks so you can read the code. Variable names that were mangled to a, b, c by terser will stay mangled — that requires a sourcemap, which a beautifier alone cannot reverse. Combine this tool with a sourcemap viewer for full unminification.
Why are my strings preserved exactly?
A correct beautifier never touches characters inside string literals. The OpenFormatter implementation tracks whether it is inside a single-quoted, double-quoted, or template-literal string and emits every character verbatim until the matching closing quote. Escaped characters (\\, \n, \') are also passed through.
Does it support modern JavaScript: arrow functions, async/await, optional chaining?
Yes. The beautifier is syntax-agnostic — it operates on braces, semicolons, and string boundaries, all of which exist in every JavaScript era. Arrow functions, async/await, optional chaining (?.), nullish coalescing (??), private class fields (#x), and dynamic import() all work without special handling.
Will it format JSX or TypeScript correctly?
Plain JS only. JSX (<div>...</div>) and TypeScript-specific syntax (type annotations, generics) parse as ordinary text — the result is technically valid but the formatting will not be ideal. For TS/JSX, use Prettier or the dedicated formatter for that file type.
How is this different from Prettier?
Prettier is an opinionated formatter that rewrites JS to a strict style (line wrapping, trailing commas, quote style) using a real parser. This beautifier is much simpler — it only restores whitespace that minification removed. Use Prettier for source code; use a beautifier for inspecting bundled or minified third-party JS.
Is my code uploaded to your servers?
No. JavaScript beautification runs entirely in JavaScript inside your browser. Code containing API keys, internal logic, or proprietary algorithms never leaves your machine. Open DevTools Network tab, click Run — you will see no requests fire.
Can I beautify code with API keys safely?
Yes. The tool runs locally — keys never leave your device. That said, exposed API keys in client-side bundles are a security issue regardless. If you find a key while beautifying, rotate it; the bundle was visible to anyone loading your site.