How sql formatter works
SQL written in one long line is hard to read and review. A formatter breaks it into a standard layout: each major clause (SELECT, FROM, WHERE, GROUP BY, ORDER BY, joins) on its own line, continuation columns indented, commas normalised, and a trailing semicolon added.
This formatter recognises the common SQL clauses — SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, LIMIT, UNION, the join types, and INSERT/UPDATE/DELETE/CREATE keywords — and places each on a new line with a fixed indent. It normalises comma spacing in select lists and tidies JOIN spacing so LEFT OUTER JOIN reads consistently.
Paste your SQL and click Format. The tool returns a readable, consistently indented query. It handles standard SELECT, INSERT, UPDATE, DELETE, and DDL statements; very dialect-specific syntax may not be perfectly pretty-printed but will still be cleaner than a single line.