SQL Beautifier
SQL ToolsExpanded, review-ready SQL layout with one column per line.
Runs entirely in your browser โ nothing is uploaded
Features
- One column, join and condition per line for clean code review diffs.
- Leading-comma or trailing-comma style.
- Aligned aliases and ON clauses.
- Optimised for pull requests rather than for compactness.
How to use the SQL Beautifier
- 1Paste the query you want to review.
- 2Pick your comma and alignment style.
- 3Copy the expanded SQL into your migration or PR.
Frequently asked questions
How is this different from the formatter?
The formatter produces balanced everyday formatting. The beautifier deliberately maximises vertical layout so line-level diffs stay small.
Why expand a query rather than keep it compact?
Because of what a diff looks like afterwards. With one column, join or condition per line, adding a column changes one line and a reviewer sees exactly that. On a compact query the same edit rewrites a long line and the reviewer has to compare the whole thing character by character. It is a formatting choice made for code review rather than for reading in isolation.
Leading or trailing commas?
Leading commas make adding or removing a column at the end a one-line change, since every line except the first begins with a comma. Trailing commas read more naturally to most people. Neither is correct in general; what matters is that a codebase picks one, because mixing them makes every diff noisier than it needs to be.
Is my query sent anywhere?
No. Formatting runs entirely in your browser, so a query containing table names, column names or literal values from your own system never leaves the tab. That is worth knowing before pasting production SQL into any online formatter.