PHP Formatter
Format and beautify PHP code with PSR-12-style indentation and brace placement. Cleans up spacing, normalises indentation, and structures your PHP for readability.
What is PSR-12?
PSR-12 is the PHP coding style standard maintained by the PHP-FIG (Framework Interop Group). It extends and replaces PSR-2, defining rules for indentation (4 spaces), brace placement, line length, namespace declarations, and more. Major PHP frameworks like Laravel and Symfony follow PSR-12, making it the de-facto standard for modern PHP development.
Frequently Asked Questions
?> tag in PHP-only files. This prevents accidental whitespace or newlines after the tag from being sent as output before headers, which can cause "headers already sent" errors. Always omit it in class files, configuration files, and includes.Enjoying this tool?
Every tool here is free, forever — no signup, no paywall. If this one just saved you real time, a small tip keeps them free and ad-light.
☕ Support This Tool →Need something built, not just formatted?
This toolbox is free. If your business needs custom software, AI integration, or a system built around this kind of tooling, that's what I do for a living.