▤ SQL Formatter / Beautifier
Paste a query, get major clauses on their own line with indented column lists and subqueries.
This is a formatting heuristic, not a real SQL parser — it tokenizes keywords, strings, comments and parentheses and applies layout rules on top. It does not validate syntax or understand any particular dialect, and unusual constructs (window functions, CTEs with complex column lists, vendor-specific syntax) may not format exactly the way a dedicated SQL-aware tool would. Comma-separated lists nested two or more parentheses deep (e.g. a function call inside a subquery) are kept on one line rather than broken further, and every open parenthesis gets a space before it — so
COUNT (*) keeps that space rather than tightening to COUNT(*). Both are valid SQL either way.