SQL Formatter
Beautify SQL queries with clean indentation and consistent keyword casing.
Your query
Lines: —
How to use the SQL Formatter
- Paste the SQL query you want to format.
- Pick how keywords should be cased.
- Click Format and copy the tidied query.
Features
- Newlines before the main clauses
- AND and OR indented under WHERE
- Uppercase, lowercase or untouched keywords
- Runs locally, no uploads
Advertisement
Frequently Asked Questions
Common questions about the free online sql formatter.
It puts each major clause on its own line and indents conditions, so long queries become much
easier to read and review.
It works on any dialect because the formatting is keyword based, including PostgreSQL, MySQL,
SQLite, SQL Server and Oracle.
No. The query is only reformatted as text and is never sent to a database.
No. Only whitespace and keyword casing change; table names, columns and string literals are
left alone.
It formats the outer clauses and indents inner AND and OR conditions. Deeply nested
subqueries may need manual tidying.
No. Everything runs locally in your browser, so your data never leaves your device.
Yes. The formatter is fully responsive and works on desktop, tablet and phone.
Yes, it is completely free with no account required.
Last updated: October 10, 2026