SQL Formatter
Turn messy SQL into readable, indented queries with uppercase keywords.
Runs entirely in your browser — nothing is uploaded.
About the SQL Formatter
The Freemium.Tools SQL formatter turns a single-line or messy query into indented, readable SQL with uppercase keywords, and can collapse it back to one line for logs or code.
Queries pasted out of application logs or ORMs arrive as one enormous line. Reviewing a join or a WHERE clause in that state is how subtle bugs survive code review.
Paste the query and it is broken onto sensible lines at SELECT, FROM, JOIN, WHERE, GROUP BY and ORDER BY, with each column and condition indented. String literals are detected first, so keywords inside quoted text are never touched.
How to use it
- 1Paste your query. Any SELECT, INSERT, UPDATE, DELETE or DDL statement, however it is formatted.
- 2Choose your style. Uppercase keywords or leave them as typed, and pick 2 or 4 space indentation.
- 3Copy the result. Take the formatted query, or switch to One line for logging and code embedding.
Frequently asked questions
Which SQL dialects are supported?
The formatter is dialect-neutral and works with PostgreSQL, MySQL, SQL Server, SQLite, BigQuery and Snowflake, because it formats structure rather than validating syntax.
Will it change what my query does?
No. Only whitespace and keyword capitalisation change; the tokens themselves are untouched, and text inside quotes is left exactly as written.
Is my query sent to a server?
No. It is formatted in your browser, which matters when the query contains table names, business logic or sample data.
Why uppercase keywords?
Uppercase keywords against lowercase identifiers are the long-standing SQL convention and make the shape of a query scannable at a glance. You can turn it off.

