Italiano

PHP formatter

Paste PHP code and get it formatted in a consistent style.

Free, no sign-up, no upload

How it works

Paste your PHP code in the box, choose the indent (2 spaces, 4 spaces or tab) and press Format.

Copy the result or download it as a file. Nothing is sent to a server: the formatting runs in your browser.

Private by design

Everything happens on your device. Files are not uploaded to any server.

Frequently asked questions

Is my PHP code uploaded anywhere?

No. It is formatted inside your browser and never leaves your device, so it is safe for private code.

Which indent can I choose?

2 spaces, 4 spaces or a tab.

Do I need the <?php tag?

No. If it is missing the tool adds it for formatting and removes it again.

Which PHP versions work?

Modern syntax up to PHP 8 is supported.

Related tools

Code formatter and beautifierFormat and beautify JSON, XML, PHP, HTML, CSS, JavaScript, TypeScript, SQL, YAML and more in your browserSQL formatterFormat and beautify SQL queries online in your browserJavaScript formatterFormat and beautify JavaScript and TypeScript online in your browserQR code generator that never expiresQR codes for links, text and Wi-Fi, no expiryUUID generatorGenerate random UUID v4 identifiers, one or hundreds at a timeRandom name pickerPick random names from a list or shuffle them into a random order

All tools →