How to use it
- Paste your SQL query.
- Pick your SQL dialect (optional).
- Click Format SQL and copy the cleaned result.
Why use it
- Read long queries in seconds.
- Spot logic errors faster with clean indentation.
- Standardize keyword casing across a team.
- Keep your SQL private; nothing is uploaded.
- Free with no account or setup.
Why formatting SQL matters
As queries grow with extra joins, filters, and subqueries, a single line of SQL becomes impossible to read. Consistent formatting (uppercased keywords, one clause per line, and correct indentation) makes queries much easier to review and debug. It also helps team members read each other's code and makes stored procedures and data pipelines easier to maintain.
Formatting conventions this tool applies
- Keywords uppercased:
SELECT,FROM,WHERE, etc. are capitalized. - Main clauses on their own line: each major clause starts a new line for scanability.
- Subqueries indented: nested parentheses are indented so structure is visible.
- Literals and comments preserved: strings, numbers, and comments are left exactly as written.
Use the Sample button to see a typical query formatted instantly, then paste your own query to clean it up before reviewing or sharing.