How to use this developer tool
- Paste PHP code.
- Select brace style and indent size.
- Choose whitespace options.
- Run formatting.
- Compare and download the result.
Format PHP source with consistent indentation, brace placement, whitespace, blank-line handling, and protected string and comment content.
It performs a lightweight token-aware format pass designed to avoid modifying quoted strings and comments while normalizing code layout.
This is a browser formatter, not PHP-CS-Fixer or PHP_CodeSniffer. Review complex heredoc, nowdoc, mixed HTML/PHP, and unusual alternative syntax manually.
Input: if($active){echo "Active";}
Output: consistently spaced and indented PHP.
Paste the source, select your indentation and brace style, and run the formatter.
Choose a numeric indent size. The output uses spaces for generated indentation.
The formatter temporarily protects quoted strings and comments before changing surrounding whitespace.
Enable Remove trailing spaces before formatting.
Use the source and output areas together, then review the changed line count in the result summary.
| Module | Purpose |
|---|---|
| Indent | 2, 4, or 8 spaces |
| Braces | Same-line or next-line |
| Whitespace | Operators and trailing spaces |
| Protection | Strings and comments |