SOQL Formatter
Pretty-print SOQL: line-break before each clause, indent subqueries, optionally uppercase keywords.
SOQL
Formatted
Output appears here.Pretty-print SOQL: line-break before each clause, indent subqueries, optionally uppercase keywords.
Output appears here.SOQL written inside Apex strings or copy-pasted from logs is usually one long line - fine for the runtime, painful to read in code review. This formatter takes any SOQL query (single-line or multi-line) and re-emits it with each clause on its own line, subqueries indented one level deeper, and keywords either left as-is or uppercased to match your team's style.
The formatter tokenises the input keeping string literals and bind variables intact, then re-emits with clause-aware indentation. SELECT, FROM, WHERE, WITH, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR UPDATE, and FOR VIEW each get their own line. Subqueries inside SELECT or WHERE clauses indent recursively. The uppercase-keywords toggle only affects reserved words; it never touches field or object API names.