SQL Formatter
Pretty-print SQL for your dialect with the sql-formatter engine.Developer ToolsSQL Formatter
Pretty-print SQL for the dialect you choose. The formatter parses SQL as text — it never executes anything.
About this tool
One keyword per line, consistent indentation, aligned commas — the sql-formatter library does this properly for a dozen dialects, including keyword casing and parameter placeholders. Your SQL is parsed as text and never executed anywhere.
How to use the SQL Formatter tool
- Pick your dialect. Standard SQL, PostgreSQL, MySQL, SQLite, MariaDB, BigQuery or T-SQL.
- Paste the query. Any single statement or script.
- Format and copy. The formatted query appears with a one-click copy.
Supported formats
Input
- SQL text for one of the supported dialects
Output
- Formatted SQL
Inputs are validated before anything is processed. Invalid values and unsupported files are rejected with a clear error instead of failing silently.
Frequently asked questions
Which dialects are supported?
Standard SQL plus PostgreSQL, MySQL, MariaDB, SQLite, BigQuery and T-SQL, each with dialect-correct keyword handling.
Does it execute my query?
Never. The formatter works on the text only; there is no database connection of any kind.
What if my query fails to parse?
The library's error message is shown verbatim, which usually points at the offending token.
Is stored-procedure syntax supported?
Partially — procedural blocks differ per dialect and are formatted best-effort.
Privacy
Everything you enter stays in this browser tab. There is no upload endpoint for tool inputs, no account, and no server-side copy of your text or files. Results are produced locally and disappear when you close the page.
No account is required and no file is ever uploaded. See the privacy policy for details about analytics and the limited data this site stores.
Known limitations
- Highly procedural code (PL/SQL blocks, T-SQL cursors) is formatted best-effort.
- Comments are preserved but not re-indented intelligently.
- No SQL linting or execution-plan analysis.
Related tools
Other free tools from the same collection.