How to use
- Paste your SQL query (several queries separated by ; are fine).
- Choose your database so its special syntax is understood.
- Pick keyword case and indent, then click Format — or Minify for a single line.
- Click Copy to copy the result.
How it works
Formatting uses the open-source sql-formatter library: each clause (SELECT, FROM, WHERE, JOIN, GROUP BY…) starts on a new line and sub-queries are indented. Minify keeps strings and quoted names exactly as they are, removes comments and joins everything into one line.
Frequently asked questions
Does it run my query or connect to my database?
No. It only rearranges the text of the query in your browser. Nothing is executed or sent anywhere, so it is safe for queries that contain table names or data.
Why do I get an error?
The query uses syntax the chosen database doesn't understand, or has a typo such as a missing quote or bracket. Try choosing the right database, or check the line and column in the message.
Does it fix mistakes in my SQL?
No. It changes only the layout. A query that is wrong before formatting will still be wrong after it.