JavaScript Beautifier

Your workspaceProcessed on your device
A few things to know.

Input can contain up to 1,000,000 UTF-16 code units. Local files must be valid UTF-8 and at most 4 MiB. Uses the Babel parser and Prettier formatting rules. Output uses LF line endings. Print width guides wrapping and long tokens can exceed it.

  1. Paste JavaScript or choose a local source file.
  2. Choose the indentation and preferred print width, then select Format JavaScript.
  3. Read the formatted source and copy it or download formatted.js.