Skip to content
Browser tool Runs locally

XML Diff & Compare

Compare two XML documents and identify structural changes without treating formatting differences as meaningful changes.

XML Document A
0 chars
XML Document B
0 chars
Examples:
Comparison result
Click Compare XML to see structural differences.

How to compare XML

  1. Paste the original in Document A.
  2. Paste the modified in Document B.
  3. Click Compare XML.

What this XML diff compares

  • Elements, attributes, text
  • Namespaces
  • Child order
  • Comments, PIs, CDATA

What differences are ignored

  • Indentation
  • Attribute order
  • Namespace-prefix renames
  • Self-closing vs. explicit empty tags

When to compare XML versions

Comparing two versions of an XML document is useful whenever a file changes over time and you need to know exactly what moved. Common cases include reviewing edits to a configuration file before deploying it, checking that an API or SOAP request/response still matches an expected payload after a service update, and confirming what changed between two exports of an RSS or Atom feed.

Structural differences vs. rendered output

This tool compares the parsed document tree, not how two files happen to look side by side as plain text. Two documents can be byte-for-byte different yet structurally identical, or look nearly the same as text while differing in element order, attributes, or namespace bindings. The diff reports on the parsed structure so formatting choices do not get mistaken for real content changes.

Reading the diff results

Start by scanning for structural changes (added, removed, or reordered elements), since those usually matter most. Text and attribute value changes are typically lower risk but worth a quick check for typos or unit mismatches. If the result set looks larger than expected, check whether an early structural change has shifted how the rest of the document lines up.

Frequently asked questions

What's the difference between a structural and a text difference?
A structural difference is an added, removed, or reordered element or attribute. A text difference is a change to the value inside an existing element or attribute, with the surrounding structure unchanged.
Will reformatting a file show up as a difference?
No. Re-indenting, changing line breaks, or converting self-closing tags to explicit empty tags does not affect the comparison, since only the parsed structure and content are compared.
Can I compare API or SOAP payloads that use namespace prefixes?
Yes. Elements are matched by namespace URI and local name, so two payloads using different prefixes for the same namespace are still compared correctly.
Does child order matter in the comparison?
Yes. Sibling elements are compared in document order, so moving a child to a different position is reported as a change even if nothing else about it differs.
Why does my diff show more changes than I expected?
A single edit near the top of a large or deeply nested document can shift matching for everything after it. Comparing smaller sections, such as one feed entry or one config block at a time, usually narrows this down faster.

Related tools