PHP Developer Suite · free · no sign-up
PHP Formatter
Format PHP code with consistent indentation.
PHP Formatter
Standardize and clean your PHP code blocks
PHP Tool
Formatted Output
About the PHP Formatter
Format PHP code with consistent indentation.
How to use the PHP Formatter
- Paste your code into the input box, or click Load Sample to load an example.
- Choose 4 Spaces (PSR-12) or 2 Spaces for the Indentation.
- Press Format PHP Code.
- Use Copy (or Download where shown) to keep the result. Clear empties the box.
Tips
- Use the same formatting across your whole project.
Frequently asked questions
Which indentation is standard in PHP?
Four spaces, as set out in PSR-12.