SQL Formatter
FreeFormat SQL queries for PostgreSQL, MySQL, SQLite with customizable indentation
sqlformatdatabasequery
All Developer ToolsRelated tools
How it works
1
Paste
Paste your SQL query into the input editor.
2
Format
Click Format to apply consistent indentation, keyword casing, and line breaks to your query.
3
Copy
Copy the formatted SQL with syntax highlighting preserved for documentation or code review.
Frequently asked questions
Does the formatter support all SQL dialects?+
It supports standard SQL and handles common syntax from PostgreSQL, MySQL, SQLite, and SQL Server. Dialect-specific extensions are formatted as generic SQL.
Is my SQL query sent to any server?+
No. Formatting runs entirely in your browser. Your queries never leave your device, so you can safely paste queries containing table names, schema details, or sensitive data.
Does it uppercase SQL keywords?+
By default, yes. SQL keywords like SELECT, FROM, WHERE, and JOIN are uppercased for readability. This is a widely adopted convention that makes queries easier to scan.
Can I format multiple statements at once?+
Yes. Separate your statements with semicolons and the formatter will handle each one individually, adding proper spacing between them.