SQL Formatter
Beautify or minify SQL for PostgreSQL, MySQL, SQLite, SQL Server, BigQuery and more, with consistent keyword case.
Runs in your browser: input and output are never sent to the server, and the platform does not store your input.
Output
Fill in the fields on the left, then run.
How to use
- 1Paste your SQL — several statements at once is fine.
- 2Pick the dialect and keyword case.
- 3Copy the formatted SQL.
FAQ
Can formatting change what the query does?
No. Only whitespace, line breaks and keyword case change; strings, identifiers and operators are untouched.
Why pick a dialect?
Databases differ in quoting, operators and keywords — PostgreSQL's :: casts, MySQL's backticks. The right dialect avoids parse errors.
What does minify remove?
Comments are removed and runs of whitespace collapse to one space; strings and PostgreSQL $$ function bodies are left exactly as they are.
Is my SQL uploaded?
No. Formatting happens in your browser; the query is never sent or executed.
