SQL Formatter

Re-indent SQL queries so major clauses start on their own line, uppercasing keywords while leaving string literals and comments exactly as written.

An SQL formatter puts FROM, WHERE, GROUP BY, and the rest of the major clauses on their own lines at a readable indent. Single quotes, quoted identifiers, and comments are tokenised, so their contents never change.

Output

                

Paste or type something above.

Questions about sql formatter

Does it uppercase my string values?
No. Keywords are uppercased outside strings and comments only, so a literal such as 'from x' stays lowercase.
Which dialect does it target?
The clause set is common SQL. Dialect-specific syntax is left alone because it is passed through as written.
Will it run the query?
No. Nothing is sent anywhere. Formatting is text processing on your device.