What this tool does
The SQL Formatter turns a cramped, one-line, inconsistently-cased SQL query into clean, readable code. Paste your query, choose whether keywords should be uppercase or lowercase, pick your indentation, and copy the beautified result straight back into your editor, migration, or pull request.
How it works
Rather than blindly find-and-replacing text, this formatter tokenises your SQL first — it splits the input into keywords, identifiers, string literals, numbers, operators, punctuation, and comments. Because it understands those token types, it can put every major clause on its own line, indent SELECT columns and JOIN ... ON conditions, and re-case keywords without ever touching what’s inside your strings or comments. A literal like 'select from where' comes back exactly as you typed it.
Free vs Pro
The formatter here is free forever and runs entirely in your browser — no account, nothing stored. For teams that want one house style everywhere, SQL Formatter Pro is planned to add saved formatting profiles, batch-formatting whole folders of .sql files, a CLI/API for CI pipelines, and dialect-aware rules. Only the free single-query formatter ships today.
Privacy
Everything runs locally in your browser. The queries you format are never uploaded, logged, or stored.