SQL Formatter
Indent and tidy complex SQL so queries stay readable.
Pick tabs or 2/4 spaces; both are common in SQL.
Convert SELECT/FROM/WHERE and JOIN keywords to uppercase.
Place each SELECT column on its own line after commas.
Move AND/OR to new lines inside WHERE/HAVING for scan-friendly filters.
Start JOIN and ON clauses on their own lines to visualize join chains.
Remove spaces at the end of formatted lines.
What
SQL Formatter definition
A SQL formatter organizes queries with line breaks and indentation.
Cases
Use Cases
Make complex joins readable
Review and share queries with teammates
Spot syntax issues in long statements
How To
How to Format SQL Queries
A step-by-step guide to making SQL queries easier to read.
Paste SQL
Paste your SQL query into the input.
Adjust rules
Choose keyword casing and line-break options.
Format and copy
Run formatting and copy the formatted SQL.
Knowledge
Understanding SQL Formatting
FAQ