JavaScript Formatter

Re-indent JavaScript with consistent braces and spacing, without changing a single character of your strings.

How it works

  • The formatter is token-aware: strings, template literals, regular expressions and comments are copied verbatim.
  • Choose K&R or Allman brace style and 2/4-space or tab indentation.
  • Minified one-liners come back as readable, properly indented code.