SQL Formatter
Make a compact SQL query easier to read and review with consistent indentation and line breaks. Choose a SQL dialect when syntax differs between PostgreSQL, MySQL, SQL Server, BigQuery, and other supported formats.
How to use this tool
- Paste or type a SQL query in the input editor.
- Select the dialect that best matches the database syntax.
- Format the query, review the output, and copy or download the result.
Tips
- Formatting changes layout, not query semantics; still review the output before running a query in production.
- Choose the correct dialect for vendor-specific functions and quoting rules.
Frequently asked questions
Which SQL dialect should I choose?
Choose the dialect used by the database that will execute the query. Vendor-specific syntax can format differently across dialects.
Does the formatter execute my query?
No. It only formats the text in your browser and never connects to a database.