SQL Formatter
Format SQL Server, PostgreSQL and MySQL queries with consistent indentation.
When to use SQL Formatter
Format a query before a code review so SELECT, JOIN and WHERE clauses are easier to inspect.
How to use SQL Formatter
- Prepare the input for SQL Formatter: A SQL query and the SQL dialect used by your database. Paste the text or use Load example.
- Select Format.
- Check the output: An indented SQL query. Copy only the result you intend to use.
A practical example
Input: select id, name from users where active = 1 order by name; Output (UPPER, 2 spaces): SELECT id, name FROM users WHERE active = 1 ORDER BY name;
Limitations and common mistakes
Select the matching dialect. Stored procedures and custom statement delimiters are not supported. Formatting does not validate or execute queries.
Questions about SQL Formatter
What should I enter in SQL Formatter?
A SQL query and the SQL dialect used by your database.
What does SQL Formatter return?
An indented SQL query.
What should I check before using the result?
Select the matching dialect. Stored procedures and custom statement delimiters are not supported. Formatting does not validate or execute queries.
Supported input and output
A SQL query and the SQL dialect used by your database.
An indented SQL query.
