SQL Formatter
Format and beautify SQL queries.
SQL
Formatted
About this tool
Paste a one-line or minified SQL statement and get a readable, indented query with keywords on their own lines. Great for reviewing generated queries and cleaning up logs.
How to use
- Paste your SQL query into the input.
- Choose uppercase or lowercase keywords and indent size.
- Click Format to get a clean, readable statement.
Examples
Input
select id,name from users where active=1 order by name
Frequently asked questions
The formatter uses common ANSI SQL keywords, which cover MySQL, PostgreSQL, SQL Server, and SQLite for most queries.
No. It only reformats text. It does not connect to any database.