JavaScript Formatter
Paste messy or minified JavaScript and get clean, readable, indented code.
JavaScript
Formatted JavaScript
Recent formatting on this device
How this tool works
Method. Statements, blocks and object entries each get their own lines with consistent indentation; operators get spaces around them. Text inside strings, template literals and comments is kept as written.
Privacy. Everything happens in your browser. Nothing is uploaded or shared; the recent-formatting record stays on this device only.
Limits. JavaScript up to 200 KB; longer input is trimmed with a warning. Invalid JavaScript is refused with the parser's message.