JavaScript Beautifier
Make minified or badly formatted JavaScript readable again. Paste code and get properly indented, line-broken output with your choice of 2 spaces, 4 spaces or tabs — handy for debugging third-party scripts, reading bundles and reviewing snippets.
Paste JavaScript (or JSON), choose the indentation and click Beautify. js-beautify restores line breaks, indentation and spacing and unescapes strings; it can't restore original variable names that a minifier shortened. The formatted code can be copied or downloaded.
Zero Server Uploads
Files process in local RAM
Instant WASM Speed
No waiting queues or lags
Unlimited Batching
Convert files without limits
Suggest a Feature or Improvement for JavaScript Beautifier
Need custom options, higher limits, or extra format support? Let our engineering team know!
How to use JavaScript Beautifier
- 1Paste the JavaScript.
- 2Choose indentation.
- 3Click Beautify JavaScript.
- 4Copy or download the formatted code.
Beautifying vs deobfuscating
Beautifying reverses the whitespace part of minification. Renamed variables (a, b, c) stay renamed, because the original names aren't in the file. Source maps (.map files), if published, let DevTools show the original source.
Heavily obfuscated code (string arrays, packed eval) needs dedicated deobfuscators; be careful running unknown code.
Related tools
Minify for production with the JavaScript Minifier, check JSON with the JSON Validator, and format stylesheets with the CSS Beautifier.
Frequently Asked Questions
Is this the same as Prettier?
Similar goal, different engine. js-beautify is more forgiving with partial or non-standard code; Prettier enforces a stricter house style.
Is my code or data uploaded?
No. Everything runs in your browser; nothing you paste is sent to a server or stored.
Related Tools
JavaScript Minifier
Minify JavaScript with Terser — shorten names, drop console calls and see the size saved.
CSS Beautifier
Format minified CSS into clean, indented, one-declaration-per-line stylesheets.
JSON Validator
Validate JSON with exact error line and column, auto-fix common mistakes, and format it.