JavaScript Formatter
Pretty-print messy or minified JavaScript with consistent indentation.
About this tool
This is a lightweight reformatter based on the structure of the code — not a full parser like Prettier. It uses a tokenizer that understands strings, template literals, regular expressions and comments, so brackets inside a regex or a URL inside a string can’t confuse it, then puts each statement on its own line and indents every block.
Your own line breaks are kept (useful for code written without semicolons), chained calls that start a new line are indented, for (…; …; …) loops stay on one line, and } else {, } catch and }); stay together. A comment at the end of a line stays on that line. It doesn’t rewrap long lines or change quotes, so it’s ideal for reading minified or messy code rather than as a final style pass.