SQL Formatter
Format SQL queries so they are readable — or minify them.
Loading tool…
Runs entirely in your browser — nothing you enter is uploaded or stored on a server.
How to use it
Format SQL with each clause on its own line, columns and conditions one per line, joins aligned and subqueries indented, keywords in upper or lower case — or minify a query onto one line. Strings and identifiers are never changed.
- Paste a query.
- Choose keyword case and indent.
- Copy the formatted SQL.
DevelopersAnalystsData engineers
Questions
Which SQL dialects work?
Standard SQL and the common dialects — MySQL, PostgreSQL (including $$ strings and :: casts), SQL Server ([brackets]), SQLite and BigQuery.
Does it check my SQL is valid?
No — it formats what it is given. A query with a typo is formatted too, which often makes the typo easier to spot.