SQL Formatter
Paste a SQL query, choose an indentation style, and produce a readable copy without sending your query to a server.
A QUICK WALKTHROUGH
How to use this tool
- Paste SQL up to 200,000 characters.
- Choose two or four spaces, or tabs, then format the query.
- Review the result and copy or download the SQL text.
Readable SQL without a database
The formatter works on SQL text only. It does not connect to a database, execute statements, resolve schemas, or fetch external resources.
Conservative token handling
Quoted strings, quoted identifiers, line comments, and block comments are kept as tokens while common clauses and punctuation are arranged for easier review.
GOOD TO KNOW
Common questions
Is my SQL uploaded?
No. Formatting, copying, and downloading happen locally in your browser.
Does this validate or execute SQL?
No. It provides conservative formatting help and does not parse, validate, or execute database statements.
Which SQL dialects are supported?
The formatter targets common SQL syntax and preserves unfamiliar keywords and expressions as text. Review dialect-specific output before running it.
Are strings and comments preserved?
Yes. Quoted values, quoted identifiers, line comments, and block comments are treated as protected tokens.