Format JavaScript Online
Paste JavaScript into the editor or upload a file and click "Format": the code is re-indented and laid out the same way everywhere, so it is easy to read, review and compare. Choose the indentation you like and copy or download the result.
Modern JavaScript is supported — modules, classes, async functions, optional chaining and JSX. Long lines are wrapped and quotes and semicolons are made consistent.
Why Use This Tool?
- Clean, consistent layout in one click
- Syntax highlighting and line numbers
- Errors shown with line and column
- Free, no registration, works in your browser
How to Format JavaScript
- Paste your JavaScript or upload a file
- Choose the options and click "Format"
- Copy the result or download it
Frequently Asked Questions
Is this tool free?
Yes, it is completely free, with no registration and no limits.
Can it unminify a .min.js file?
Yes. Paste minified code and click "Format": it is spread over readable lines again. Shortened variable names can't be restored, though — that information is gone.
Is my code sent anywhere?
No. Everything runs in your browser: the code you paste or the file you choose never leaves your device.