SQL formatter online
Turn a dense query into something a teammate can review before it becomes a migration, report, or production fix.
Waiting for input...Why format SQL?
Dense SQL is where small mistakes hide: the wrong join, a missing parenthesis, a filter attached to the wrong clause, or an alias that looked obvious yesterday. Formatting does not make a query correct, but it makes the intent visible enough to review.
Dialect quick reference
| Dialect | Common traits | Recommended setting |
|---|---|---|
| Standard SQL | General-purpose baseline for simple relational queries. | Uppercase keywords, 2-space indentation |
| MySQL / MariaDB | Backticks, LIMIT clauses, and MySQL-specific syntax. | MySQL dialect |
| PostgreSQL | $tag$ strings, JSONB operators, and cast-heavy syntax. | PostgreSQL dialect |
| Transact-SQL (T-SQL) | Square-bracket identifiers, TOP clauses, and SQL Server syntax. | T-SQL dialect |
Frequently asked questions
Does this upload my SQL to a server?
No. Formatting happens in the browser, so the query text stays on the page.
How do I reformat minified SQL?
Paste the one-line query into the input pane and choose the closest dialect. The formatter will rebuild line breaks, indentation, and keyword casing automatically.
Can formatting change how a query runs?
Whitespace and keyword casing should not change SQL semantics. Still, treat formatted output as code: review it, run tests, and be careful around dialect-specific syntax.
Which SQL dialect should I choose?
Choose the database that will execute the query. PostgreSQL, MySQL, and SQL Server have different quoting rules, functions, casts, and limit syntax, so the closest dialect gives the cleanest result.