SQL Formatter
Turn a cramped SQL query into a neatly indented one.
Usage examples
Cleaning up a one-line query copied from a log
Paste a long single-line query from an application log or slow query log and get it back broken into readable, clause-by-clause lines.
Improving readability for a code review or docs
Tidy a query's indentation before dropping it into a pull request or technical document so others can follow its structure at a glance.
Matching your team's keyword style
Convert keywords like SELECT and FROM to all-uppercase or all-lowercase to match your team's SQL style guide.
Frequently asked questions
Is my query sent to a server?
No. All formatting happens entirely in your browser, and what you enter is never sent to a server.
Does this actually run the query or connect to a database?
No. This tool only reformats the text for readability — it never connects to any database or executes anything.
How do I pick the right SQL dialect?
Choose the dialect matching the database you're using so dialect-specific syntax (like MySQL backticks or PostgreSQL operators) is recognized more accurately. If you're not sure, Standard SQL works fine for most queries.
What happens if there's a syntax error?
If the query has mismatched parentheses or a syntax error, formatting fails and an error message tells you roughly where the problem is.