How to format SQL
Turn a cramped, hard-to-read query into clean, indented SQL with consistent keyword casing.
1. Paste your SQL
Drop in a query for MySQL, PostgreSQL, SQL Server and more.
2. Format
Get tidy indentation, line breaks and uppercased keywords instantly.
3. Copy
Copy the beautified query back into your editor or ticket.
A SQL formatter makes long SELECTs, JOINs and CTEs readable, which helps with code review, debugging and sharing queries with teammates. Consistent formatting also reduces mistakes by making the structure of the statement obvious. It runs locally, so proprietary queries stay private. For other code, use the Code Beautifier.