SQL Formatter
🔒 Runs in your browser
Five dialects, one formatter
Pick the dialect that matches your database — standard SQL, MySQL,
PostgreSQL, T-SQL (SQL Server) or SQLite — and the
formatter parses dialect-specific syntax correctly, from PostgreSQL's :: cast
operator to T-SQL's square-bracket identifiers, before laying the query out across clean,
indented lines with keywords cased the way you choose.
Safe for production queries
Formatting runs entirely in your browser via the open-source sql-formatter
library — nothing you paste is uploaded or logged, so pasting a query straight out of a
production database, an ORM debug log or a migration file carries no more exposure than
opening it in a local text editor.
Frequently asked questions
Which SQL dialects are supported?
Standard SQL, plus MySQL, PostgreSQL, T-SQL (SQL Server) and SQLite — each with its own quoting, cast and keyword rules recognized by the parser.
What do the uppercase and indent options control?
Uppercase forces keywords like SELECT and FROM to uppercase (identifiers are left untouched); indent sets the block width — 2 or 4 spaces — used for nested clauses.
Is my SQL sent to a server?
No. Formatting runs entirely in your browser using the open-source sql-formatter library — production queries, table names and data never leave your device, safe to paste even from a live database.
What happens with invalid or unparseable SQL?
The formatter reports a parse error instead of guessing; text that is not valid for the selected dialect returns a clear error message rather than corrupted output.