SQL Formatter
SQL Formatter Online – Format SQL Queries
Loading tool…
About SQL Formatter
A SQL Formatter pretty-prints query code to make it human-readable. It organizes key statements, nests clauses, and handles case styling for SQL dialects.
How It Works
Using a dialect-aware tokenizer, the tool maps out queries and indents them based on your settings (spaces or tabs), completely client-side in the browser.
How to Use SQL Formatter
- Paste your unformatted SQL code query into the syntax input area.
- Select the dialect matching your database (e.g. PostgreSQL, MySQL) from the header.
- Choose the indent size and keyword case preference (uppercase/lowercase).
- Copy or download the clean, formatted SQL result.
SponsorshipTool footer
FAQ
Which dialects are supported?
Standard SQL, MySQL, PostgreSQL, T-SQL (SQL Server), Snowflake, BigQuery and SQLite. Choose the dialect that matches your source for the most accurate keyword handling.
Under the hood
Built on the open-source `sql-formatter` parser. The dialect grammar is selected at runtime; formatting itself is synchronous and fast enough to stay on the main thread for queries up to a few hundred kilobytes.
Engineered by HaorGrix