Paste JavaScript and get clean, consistently indented code. Strings, comments, regular expressions and template literals stay exactly as written — formatting is done in your browser, nothing is uploaded.
Paste any JavaScript — a single function, a snippet from a code review or an entire file — and this formatter rewrites the whitespace so the structure becomes readable. Nested blocks are indented, statements start on their own lines, and operators, commas and parentheses get consistent spacing. Strings, comments, regular expressions and template literals are copied through byte for byte, so nothing inside them is ever altered. Choose two spaces, four spaces or tabs, then copy the result or download it as a .js file. An unbalanced bracket, an unterminated string or an unclosed comment is reported with its line number instead of being silently reformatted. Everything runs in your browser: the code you paste is never uploaded.