SQL Formatter
Free online SQL formatter — beautify and indent SQL queries for PostgreSQL, MySQL, SQLite, T-SQL, BigQuery and standard SQL, in your browser.
Runs entirely in your browser — nothing you enter is uploaded or stored.
Beautify SQL queries for any major dialect
Paste a messy one-line query and get a cleanly indented, keyword-cased statement that is far easier to read and review. Choose your database dialect so the formatter treats identifiers, quoting and dialect-specific keywords correctly.
Tips
- Set the dialect before formatting — PostgreSQL and Transact-SQL differ in how they quote identifiers.
- The formatter runs in your browser, so credentials, table names and data in your query never leave the page.
- It formats one or many statements; separate them with semicolons.
Credits
This tool is powered by open-source libraries that run in your browser:
- sql-formatter — SQL formatting (MIT)
Frequently asked questions
Which SQL dialects are supported?
Standard SQL plus PostgreSQL, MySQL, MariaDB, SQLite, BigQuery and Transact-SQL (SQL Server). Pick the one that matches your database so keywords and quoting are formatted correctly.
Does formatting change what my query does?
No. The formatter only adjusts whitespace, capitalisation of keywords and line breaks. The statement itself is untouched, so results are identical.
Why did I get an error?
The formatter can choke on very unusual or invalid syntax. When that happens the error message from the formatter is shown and the output is left blank — fix the highlighted part and try again.
Is my data uploaded?
No — everything runs locally in your browser. Nothing is uploaded.