XML Formatter

Indent a one-line XML payload so you can read it, or squash a formatted file for transport. The document is checked for well-formedness first.

How it works

Tags are re-indented by depth. Text content, attribute values, comments and CDATA sections are kept.

In mixed content (text and elements side by side, as in XHTML) whitespace can be meaningful, so check the output before using it for documents rather than data.

Everything above runs in JavaScript inside this tab. Your data is not uploaded. Inputs are remembered in this browser only so they survive a reload; you can switch that off on the privacy page.

Questions

Does formatting change the XML data?

Only insignificant whitespace between tags changes. If your application treats whitespace-only text nodes as meaningful, use minify mode or keep the original.

Can it format SVG and RSS?

Yes, both are XML.