Apex Formatter
Re-indent Apex by curly-brace depth and (optionally) uppercase keywords. Quick clean-up for code copied out of dev console.
Apex
Formatted
Output appears here.Re-indent Apex by curly-brace depth and (optionally) uppercase keywords. Quick clean-up for code copied out of dev console.
Output appears here.The Salesforce Developer Console doesn't carry indentation hints when you copy code into another window, and Quick Actions / Formula Editor outputs are notoriously messy. This formatter re-indents any Apex snippet by curly-brace depth - 4 spaces per level by default - and gives you a one-click "uppercase keywords" toggle for teams that prefer the SQL-style convention.
The formatter tokenises the input keeping string literals, comments, and SOQL inline blocks (`[ SELECT ... ]`) intact. It then walks each line, increments the indent on `{` and decrements before `}`, and writes the result with consistent spacing. The uppercase-keywords toggle uppercases the Apex reserved word set without touching identifier names, string content, or method calls.