JavaScript Formatter

Beautify JavaScript with clean, consistent indentation in your browser.

  • Proper indentation (js-beautify)
  • 2 spaces, 4 spaces or tabs
  • Copy / download

How to use the JavaScript Formatter

  1. Paste JS
  2. Click Format
  3. Copy indented code

Frequently asked questions

Is this Prettier?

No. It uses the open-source js-beautify engine, which keeps strings, regexes and loops intact. For a team code style, run Prettier in your editor.

Related tools

All 96 free tools More developer tools