Developer Tools
HTML Formatter
Pretty-print HTML via the browser’s own parser, inline tags kept inline.
Powering up the tool…
What this tool does
About the html formatter
Fragment or document, normalisation disclosed.
How to use it
- Paste HTML (fragment or whole doc).
- Read the indented result.
- Note that the PARSER normalised it (as browsers do).
- Copy out.
Useful for
- Clean pasted-from-anywhere markup.
- Make view-source output reviewable.
- Normalise before comparing two versions.
Straight answers
HTML Formatter FAQ
Why did my markup change slightly?
It went through a real HTML parser — the same forgiving machine browsers use — which closes implied tags and normalises structure. What you get back is what browsers were already seeing; sometimes that itself is the revelation.
Why are spans and links not broken onto lines?
Whitespace between inline elements is RENDERED in HTML — naive pretty-printers add visible gaps around links. This one keeps inline runs inline, which is the difference between formatted and broken.