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.Re-indent Apex by curly-brace depth, or pretty-print a standalone SOQL query. Auto-detects which one you pasted.
Output appears here.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.