SQL Formatter
Format SQL with keywords in capitals and one major clause per line.
Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.
SQL Formatter
How to use this tool
- Paste your SQL into the box.
- Press Format to upper-case keywords and put major clauses on their own lines.
- Copy the result with Copy result and paste it back into your editor.
Worked example
Format the sample: select id, name from users where age > 18 order by name becomes SELECT id, name, then FROM users, WHERE age > 18 and ORDER BY name each on its own line.
What this tool does not do / Limits
This is a readability formatter, not a SQL parser: it does not validate SQL, does not understand every dialect, and can misplace keywords inside string literals. Always check the formatted query still runs before using it.
Frequently asked questions
Does it change what the query does?
No — it only changes whitespace and keyword case. It never renames tables or columns or reorders clauses.
Can it format very long queries?
Yes, for typical pasted queries. Extremely long pastes (hundreds of thousands of characters) may be slow; split them if the page lags.
Related tools
JSON Studio
Format, validate, minify, query and compare JSON in your browser, with precise line-and-column errors.
LiveRegex Tester
Test patterns against sample text with match highlighting, capture groups and a safe one-second timeout.
LiveSecurity Header and DNS Checker
Check HSTS, CSP and other security headers, TLS details, and DNS/email authentication records (SPF, DKIM, DMARC).
Live