Developer
SQL formatter
Pretty-print SQL without sending the query to a database or a server.
This tool processes files and text locally in your browser. Your content is not uploaded or stored by this site.
Empty. Paste text, drop a file, or load the example.
What this tool does
sql-formatter rewrites whitespace and keyword case. It does not run EXPLAIN, it does not connect to a database, and it does not guarantee that a rewritten query is semantically identical for every dialect quirk.
How to use it
- Choose a dialect.
- Paste SQL.
- Copy the formatted query.
Supported input
- SQL text, UTF-8, up to 2 MB
Output
- Formatted SQL with uppercase keywords
Privacy
This tool processes files and text locally in your browser. Your content is not uploaded or stored by this site.
ConvertPass does not include your input in analytics, URLs, or error reports. Encoding: UTF-8. Limit: 2 MB (2.00 MB).
Limitations
- Vendor-specific extensions may format poorly.
- Formatting is not a security control against SQL injection.
Example
select id,name from tools where local=true order by name;
SELECT id, name FROM tools WHERE local = true ORDER BY name;
Troubleshooting
- The formatter throws on a query that runs in production
- Switch dialect, or reduce the query to the statement that fails. Unclosed quotes are the usual cause.
FAQ
Does this execute SQL?
No. There is no database connection.
Should I paste production queries with customer data?
Avoid it. The tool is local, but query text still sits in page memory. Redact literals when you can.
Why uppercase keywords?
It is a common convention that makes clauses easy to scan. Identifiers keep their original case.
Can it format a whole migration file?
Multiple statements often work. If one statement fails, split the file.
Related tools
- JSON formatter
Pretty-print JSON locally with clear parse errors and a one-click copy.
- Regex tester
Try a JavaScript regex locally with safe highlighting.
- CSV to JSON
Parse real CSV into JSON without breaking on commas inside quotes.
Related guides
Related formats
Last reviewed 16 August 2026. Report a problem. Reports do not include your input.