Reformat a SQL query for easier reading without connecting to a database. Formatting can help you review clauses and nested expressions before using your normal database tools.
How to use this tool
For example, a SELECT with columns, a FROM clause and a WHERE condition is easier to scan after formatting. Formatting changes whitespace and line breaks while keeping the query text available for review; compare the output with the original before running important SQL.
- Paste the query into SQL.
- Select Format SQL.
- Review the transformed query and copy it when suitable.
How to interpret the result
The formatter uses its supported SQL grammar and has no database connection. It does not execute queries, check table names, inspect indexes or prove a query is safe. Dialect-specific syntax may be unsupported.
Frequently asked questions
Will this improve query performance?
Formatting changes readability rather than the query plan. Performance analysis requires the target database and representative data.