Free dev tools
Apex & SOQL Formatter
Re-indent Apex by curly-brace depth, or pretty-print a standalone SOQL query. Auto-detects which one you pasted.
Apex or SOQL
Formatted
Output appears here.Related dictionary terms
Keep building
About this tool
Paste an Apex class, trigger, or anonymous block and this tool re-indents it by curly-brace depth, with an optional uppercase-keywords toggle. Paste a standalone SOQL query and it pretty-prints each clause on its own line with subqueries indented one level deeper. The tool sniffs the input and routes to the right formatter, so you don't have to pick a mode.
On every keystroke the tool checks whether the input looks like a SOQL query (trimmed text starts with SELECT or FIND, no class/trigger/interface keyword, no top-level curly braces). SOQL input goes through the SOQL formatter: tokenise keeping string literals and bind variables intact, then re-emit with each clause - SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR UPDATE - on its own line. Apex input goes through the Apex formatter: tokenise keeping strings, comments, and embedded `[ SELECT ... ]` blocks intact, then walk line by line incrementing indent on `{` and decrementing before `}`. The uppercase-keywords toggle and indent size apply to both modes.
- Cleaning up Apex copied from a debug log or someone else's Slack message.
- Pretty-printing a one-line SOQL query pulled from a log before pasting it into a code review.
- Normalising a class's indentation before committing - useful when teams contribute from a mix of editors.
- Quick formatting before posting an Apex snippet or SOQL query into a code review when you can't reach for a full IDE.