About SQL Formatter
Turn a one-line query into something readable, with clauses on their own lines and joins lined up. Pick the dialect you actually use so its specific keywords and quoting rules are respected.
Why the dialect matters
Dialects disagree about quoting, string escapes and their own keyword lists. Formatting a BigQuery query as standard SQL can misread a backtick-quoted table name; formatting SQL Server as MySQL mishandles square-bracket identifiers. Choosing the right one avoids output that is subtly wrong.
Queries are data too
A query often carries table names, column names and literal values from production, which is why pasting one into a server-side formatter is a quiet data disclosure. Formatting here happens in your browser and nothing is transmitted.
Frequently asked questions
- Does formatting change what my query does?
- No. Only whitespace and keyword case change, and keyword case is not significant in SQL. Identifiers and string literals are left exactly as written.
- Why is my query rejected?
- The formatter has to parse the statement, so a genuine syntax error will stop it. A missing closing parenthesis or an unterminated string literal is the usual cause.
- Can it format multiple statements?
- Yes. Statements separated by semicolons are each formatted, and the status line reports how many were found.