SQL formatter online
Beautify SQL queries, normalize keyword casing, and reflow indentation across multiple database dialects.
Dialect:
Indent:
Keywords:
Input SQL
Formatted output
Waiting for input...Why format SQL?
Complex joins, nested subqueries, and long filter clauses become hard to scan when they are compressed into one block. Formatting helps teams read intent faster and debug queries with less friction.
Readable structure: Consistent indentation and line breaks make clauses, joins, and conditions easier to follow.
Team consistency: A shared formatting style reduces review noise and keeps migrations, dashboards, and stored queries easier to maintain.
Faster debugging: A cleaner layout makes logical mistakes, missing aliases, and broken conditions easier to spot.
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 entirely in the browser, so the query text never leaves 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.