Useful Hacks

JavaScript Formatter

Format and beautify JavaScript code.

Processed locally in your browser. Nothing you enter is uploaded or stored.

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.

How to use it

  1. 1Paste JavaScript code.
  2. 2The formatted output updates automatically.

How it works

Uses js-beautify, a widely-used JavaScript beautifier, to tokenize and re-indent your code correctly — including strings, template literals and comments — rather than a naive line-based approach that risks breaking code.

Tips

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

Related tools

All developer tools

Search tools

Search for any tool by name, category or keyword