What is the JavaScript Formatter?
Paste any JavaScript, even one long line from a minified file, and get tidy code with consistent spacing and indents. It understands modern JavaScript, JSX and ES modules.
Pick the indent size, line width, semicolons and quote style. If the code has a syntax error, you see the line and a short note.
How to use it
- Paste your JavaScript in the left box.
- The clean version shows on the right.
- Copy it or save it as a file.
Why people like this tool
Prettier powered
The same formatter many teams use.
Fast and private
Runs in your browser, nothing is sent.
Shows the error
Tells you where the code is broken.
Your style
Choose indent size and line width.