What it does
This tool takes a cramped, one-line or inconsistently indented SQL statement and pretty-prints it: keywords are upper-cased, clauses such as SELECT, FROM, WHERE and ORDER BY start on their own lines, and nested expressions are indented so the structure of the query is easy to read. It uses the open-source sql-formatter library and reformats as you type.
How it works
Pick a dialect first — Standard, MySQL, PostgreSQL, MariaDB or SQLite. The dialect controls which words are treated as reserved keywords and how dialect-specific syntax (backtick identifiers, LIMIT clauses, dollar-quoted strings, and so on) is tokenised. The formatter only rearranges whitespace and keyword casing; it never changes the meaning of your query, reorders clauses, or validates that the tables and columns exist. Your identifiers and string literals are passed through untouched.
Gotchas
- Choosing the wrong dialect can mis-case or misalign dialect-specific syntax. If backticks or
::casts look wrong, switch dialects. - A syntax error in the input shows a
⚠message instead of formatted output — fix the unbalanced parenthesis or missing quote and it re-renders. - It formats, it does not beautify logic: a
SELECT *staysSELECT *. It is a readability aid, not a linter or optimiser.
Worked example
Paste select id,name from users where active=1 order by name and you get each clause on its own line with keywords upper-cased and the column list indented — far easier to review in a pull request or paste into migration notes. For exploring the shape of query results, pair this with CSV ↔ JSON or JSON; to compare two versions of a query, use Text Diff.
Privacy
Formatting is local; the query is never uploaded.