SQL Formatter
Make long queries readable: consistent indentation, line breaks and keyword case, for nine SQL dialects.
Formatted SQL
Why format SQL
- Formatted queries are far easier to review in pull requests and to debug.
- One clause per line (SELECT, FROM, JOIN, WHERE) makes missing joins and filters stand out.
- A consistent style keeps diffs small when queries change.
Frequently asked questions
How do I format SQL online?
Paste your query on the left and pick your database. The formatted SQL appears on the right with consistent indentation and line breaks.
Which databases are supported?
Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery and Snowflake.
Does formatting change what my query does?
No. Only whitespace and keyword case change. Always review the result before running it, as you would any query.
Is my SQL uploaded?
No. It is formatted in your browser, so table names and data in your queries never leave your device.