XML Diff

Paste two XML documents and see element-level differences — attribute order ignored, nothing uploaded.

Both documents are parsed and compared entirely in your browser — nothing is uploaded, and nothing is written to the URL.

Attribute order is ignored; element order is not. Namespace prefixes are compared literally.

Element by element, not line by line

XML carries a lot of formatting that has no meaning: indentation, line breaks between elements, the order attributes happen to be written in. A text diff reports all of it. This tool parses both documents with the browser's own XML parser and compares the resulting trees, so <a x="1" y="2"/> and <a y="2" x="1"/> are recognized as the same element, and a pretty-printed document matches its minified twin.

What is ordered and what is not

Attributes are unordered — they are matched by name, so only genuine additions, removals, and value changes are reported. Child elements are ordered, because in XML the sequence of elements is part of the data; a list of <item> elements means something different if you shuffle it. Element children are aligned with a longest-common-subsequence match, so inserting one element in the middle of a list is reported as a single addition rather than making every element after it look changed.

Whitespace, comments, and CDATA

By default, text nodes that contain nothing but whitespace are ignored (this is what makes indentation invisible) and comments are skipped. Turn either option off to compare them: with whitespace significant, the difference between <a>text</a> and a version with a newline inside the element becomes a real change — which matters for formats where whitespace is data. CDATA sections are compared as ordinary text, since that is what they contain.

Documented limitations

Mixed content — text interleaved between child elements, as in <p>a<b/>c</p> — is compared as the element's combined text plus its child list, so a change purely in where the text sits between the same children is not detected. For document-style XML with significant interleaving, use the text diff alongside this tool.

Namespaces

Namespace prefixes are compared literally. Two documents that bind the same namespace URI to different prefixes — ns:tag in one and x:tag in the other — are semantically equivalent to an XML processor but will show as different here. Resolving prefixes to URIs properly is doable, and doing it halfway is worse than not doing it, so this tool is explicit about comparing what is written rather than guessing at intent.

Nothing leaves your browser

Both documents are parsed and compared locally. Nothing is uploaded, and nothing is written to the URL — which matters for the SOAP payloads, signed documents, and configuration files people actually diff.

Related tools: the JSON, YAML, and CSV diff tools for other structured formats, and the text diff when you need to see the raw characters, whitespace and all.