SQL Formatter

Re-indent SQL with each clause on its own line, uppercase keywords if you like, and one statement per line.

How it works

  • Major clauses (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY) start on a new line and are indented consistently.
  • Strings, quoted identifiers and -- / /* */ comments are never rewritten — only their surrounding whitespace changes.
  • Choose to uppercase, lowercase or keep the case of SQL keywords.