HEREDOC / NOWDOC
Multi-line string literals are preserved verbatim.
Fix: No action needed — indentation respects string boundaries.
header • up to 320x100 / 728x90
Read and pretty-print PHP source with brace-balanced indentation and syntax highlighting
Output will appear here...
content bottom • up to 300x250
sidebar • 160x600
Last reviewed:
PHP is a server-side scripting language that powers a large share of the web, including platforms like WordPress, Drupal, and Laravel-based applications.
PHP Code Viewer is a quick-look tool for PHP classes, functions, and scripts. It re-indents your code with balanced braces and renders it with syntax highlighting.
It runs entirely in the browser, so you can safely inspect proprietary PHP code without sharing it with a server.
<?php function hi($n){echo "Hi $n";}hi("Ada");<?php
function hi($n) {
echo "Hi $n";
}
hi("Ada");Multi-line string literals are preserved verbatim.
Fix: No action needed — indentation respects string boundaries.
PHP templates with HTML are re-indented by braces only.
Fix: Use an HTML formatter for the HTML portions.
No — this is a pretty-printer only.
No — processing is client-side.
Yes — they're preserved with their original line breaks.
All — input is treated as text.
Beautifier has deeper formatting; the Viewer is fast re-indent.
Pair with PHP Beautifier, JSON, and regex tools. You can also browse the full Viewers category for more options.
Format PHP code online with PSR-12 or a default style for cleaner indentation, brace placement, and copy-ready output.
Format, validate, and beautify JSON online with readable indentation, syntax checking, and copy-ready output for APIs, logs, and config files.
Test and debug regular expressions
Pretty-print Java source code with syntax highlighting — paste any class, interface, or snippet
Pretty-print C# source with syntax highlighting — handy for code reviews and snippets
Pretty-print JavaScript source with indentation and syntax highlighting for quick inspection
View and render BBCode
View CSV data in a table format
View OPML (Outline Processor Markup Language) files
View and parse RSS feeds
Inspect workbook sheets and export spreadsheet data in the browser
Open and inspect PDF documents directly in the browser