SQL formatter/beautifier
What this SQL formatter does
It re-indents SELECT, JOIN, WHERE, and subqueries so dense one-liners from ORMs or logs become reviewable. Different dialects (PostgreSQL, MySQL, T-SQL) have incompatible extras—this page aims at readable layout, not guaranteed parse-and-execute fidelity on every vendor keyword.
When to use it
Use it before pasting a query into a design doc, when onboarding someone onto a 400-line report SQL, or when you screenshot slow-query logs for Jira. Redact customer emails, account IDs, and internal hostnames first; formatting does not anonymize data. Compare alongside JSON validator & beautifier when APIs return error payloads next to SQL traces.
Worked example
An ORM emits a single-line join monster. After beautifying, reviewers notice a missing ON predicate that was visually buried—catching a Cartesian product before it hits prod.
Frequently asked questions
Will this optimize my query?
No. Execution plans come from the database engine; formatting is cosmetic unless your tool also rewrites predicates.
Can I format DDL or procedural blocks?
Quality varies by dialect; stored procedures with nested delimiters may need IDE-specific formatters.
Is it safe for production secrets?
Assume anything typed could leave your machine via extensions or shoulder surfing. Use masked staging copies.