Useful Hacks

JavaScript Formatter

Format and beautify JavaScript code, with configurable indent and brace style.

Processed locally in your browser. Nothing you enter is uploaded or stored.
  • Re-indents and spaces code without touching strings, template literals or comments.
  • Matches your project's actual style — indent size (2/4 spaces or tabs) and brace placement (same line or own line), not one fixed default.
  • Fast way to make minified or messy code reviewable.
  • Runs in your browser; code isn't uploaded.

Why this is private

  • Processed locally in your browser. Nothing you enter is uploaded or stored.
  • Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
  • Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.

Overview

Re-indents and cleans up JavaScript so it's consistent and easy to read — useful for minified code or code pasted from inconsistent sources. Choose 2 spaces, 4 spaces or tabs, and whether braces sit on the same line or their own.

How to use it

  1. 1Paste JavaScript code.
  2. 2Pick an indent size and brace style to match your project's convention.
  3. 3The formatted output updates automatically.

Tips

  • This re-indents and spaces code consistently; it doesn't rewrite logic or enforce a style guide the way a linter would.

Frequently asked questions

What people use it for

Read a minified bundle or snippetExpand production JS enough to trace what a function does.
Tidy code pasted from a chat or article to match your project's styleFix inconsistent indentation and brace placement before dropping it into a codebase with its own conventions.
Normalise a quick scriptFormat a one-off Node script so it's maintainable.
Prepare code for a screenshot or docsConsistent formatting reads better in a tutorial.

Related guides

Related tools

All developer tools

Ready to use JavaScript Formatter?

JavaScript Formatter

Search tools

Search for any tool by name, category or keyword