SQL Formatter

Paste a SQL query and get it back indented, with keywords aligned and clauses on their own lines — the difference between a 400-character single line and something you can read in a code review. Formatting runs in your browser, so a query naming your real schema stays private.

Runs in your browser — nothing is uploaded

Questions

Which SQL dialects work?
Standard SQL plus the common extensions — PostgreSQL, MySQL, SQL Server and SQLite queries all format correctly. Very dialect-specific syntax such as a stored-procedure body may be indented conservatively rather than idiomatically.
Does it change what my query does?
No. Only whitespace and line breaks change; every keyword, identifier and literal is preserved exactly. The formatted query is character-for-character equivalent to the original as far as the database is concerned.
Is my query sent anywhere?
No. Formatting is local to your browser, which matters more here than for most tools — a query usually names your tables, columns and sometimes real values, and that is a schema disclosure you would not want to paste into an unknown server.

What people use next