appzasGamesToolsDevLearnCheat sheetsQuick calcsConvertersReferenceNetworkTimeCalculatorsCompareLLM prices

SQL Formatter

Paste a query to get it indented and easy to read. Strings, quoted names and comments are never changed.

What it changes

Each major clause (SELECT, FROM, WHERE, GROUP BY, ORDER BY) starts on its own line. Selected columns go one per line, joins are indented and AND/OR conditions line up under WHERE. Subqueries in parentheses are indented one level.

What it never changes

The text inside string literals, quoted identifiers and comments stays exactly as you typed it, and function names keep their case. Formatting only changes whitespace and keyword case, so the query means the same thing afterwards.

Limits

It understands standard SQL used by PostgreSQL, MySQL, SQLite and SQL Server for everyday queries. Vendor-specific syntax such as procedural blocks may keep its original line breaks. Always run the formatted query against a test database before relying on it.

Everything runs in your browser; nothing you enter is uploaded. See our privacy policy.