Free SQL Formatter
Paste a messy one-line query and get it back cleanly indented, with keywords capitalised and every clause on its own line. Runs in your browser — no account, nothing stored.
Why formatted SQL is worth the two seconds
Readable SQL is easier to review and much easier to debug. When each clause sits on its own line you can see at a glance that a JOIN is missing its ON condition, that a filter landed in WHERE instead of the join, or that a stray comma is sitting before FROM — the exact mistakes behind the most common SQL syntax errors.
Formatting only rearranges whitespace and keyword casing, so the result runs identically. Strings, comments and quoted identifiers stay untouched.
Frequently asked
Is this SQL formatter free?
Yes. Formatting runs entirely in your browser, needs no account, and nothing you paste is sent anywhere or stored.
Which databases does it support?
The formatter is dialect-agnostic — it works with MySQL, PostgreSQL, SQL Server, SQLite, Oracle, BigQuery and Snowflake syntax because it only reformats whitespace and keyword casing.
Does formatting change what my query does?
No. Only line breaks, indentation and keyword capitalisation change. String literals, comments and quoted identifiers are left exactly as you wrote them.
Need the query written, not just tidied?
Describe what you want in plain English and SQLGenie writes the SQL — or paste a broken query and it fixes and explains it. Free, no account.