XML Compare Online - Diff XML Documents

Compare and diff two XML documents. Fast, secure, and completely free. All processing happens in your browser — no data is sent to any server.

What is XML Compare?

XML Compare parses two XML documents into their element trees and reports structural differences — added or removed elements, changed text content, and differing attribute values — while correctly distinguishing between an element's children and its attributes, which a plain text diff cannot do reliably. XML's flexibility (self-closing tags, attribute order that doesn't affect meaning, optional namespaces) means two documents that render identically can look very different as raw text; this tool compares what the XML actually represents rather than how it happens to be formatted.

How to Use XML Compare

  1. Paste the original XML document into the left panel and the modified version into the right
  2. The comparison runs as you type: both documents are re-indented the same way, then diffed side by side
  3. Toggle whether attribute order should be treated as significant
  4. Read the result line by line: removed lines appear on the left, added lines on the right
  5. Review the summary to see counts of added, removed, and changed nodes

Key Features

Why Use XML Compare?

XML configuration files, SOAP payloads, and data exports are frequently regenerated by different tools that format them slightly differently — one library self-closes empty elements, another writes them as open/close pairs; one preserves attribute order, another doesn't. A text-based diff turns all of that formatting noise into a wall of false-positive changes. A structural comparison filters that out so you can see the differences that actually matter: a changed attribute value, a missing child element, or altered text content.

Common Use Cases

Frequently Asked Questions

Does it treat <tag/> and <tag></tag> as different?

No — both represent an identical empty element, and the comparison treats them as equal regardless of which self-closing style was used in the source.

Does attribute order affect the comparison result?

Not by default — attribute order in XML has no semantic meaning, so the tool compares the set of attributes and their values rather than their sequence, unless you explicitly enable order-sensitive comparison.

How does it handle XML namespaces?

Elements and attributes are compared including their namespace context, so a element in one namespace is correctly distinguished from an identically-named element in a different namespace.

Can it compare documents with different XML declarations or encodings?

Yes, the XML declaration itself (<?xml version=...?>) is metadata about the document rather than content, so differences there don't affect the structural comparison of the actual data.

Does whitespace between tags cause false differences?

No, insignificant whitespace used purely for indentation is ignored; only meaningful text content within elements is compared.

Guides

Related Tools