NV ToolkitFormat · Validate · Convert

Text Tools

XML Diff Checker

Two XML documents side by side with markup highlighting, so an attribute edit reads differently from a text-node edit at a glance.

In short

Compare two XML documents side by side with markup syntax highlighting — POMs, feeds, SOAP envelopes and configuration. Free, instant and fully private.

By NaveenKumar T · Updated

Learn: XML Tutorial: Structure, Syntax & Survival Skills

  • XML syntax highlighting in both panes
  • Aligned side-by-side comparison
  • Attribute and text changes highlighted inline

Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →

Learn more

Comparing markup, and the normalization that makes it readable

XML diffing has a reputation for being noisy, and the reputation is deserved when you compare raw documents straight out of two systems. The same logical document can differ in indentation, in attribute order, in whether empty elements are written `<tag/>` or `<tag></tag>`, in namespace prefixes, in the presence of an XML declaration, and in line endings — none of which change what a parser sees, all of which change what a text comparison reports.

The fix is normalization before comparison, and for XML the single highest-value step is formatting both sides to the same indentation. A minified document on one side and an indented one on the other produces a diff in which literally every line differs; the XML Formatter applied to both turns it into a diff of the handful of elements that actually changed. It also validates as it goes, so a document that will not format is a document with a structural problem you would rather find before you start comparing.

With both sides normalized, the highlighting earns its keep. Element names, attribute names, attribute values and text content are coloured separately, so `<price currency="USD">329.99</price>` becoming `<price currency="EUR">329.99</price>` reads instantly as an attribute change rather than as an anonymous altered line. The comparison itself is the same one the plain Text Diff runs: matching lines aligned, insertions marked on the right, deletions on the left, and the changed characters highlighted inside modified lines. Both panes remain editable.

Where XML comparison earns its keep

Build configuration is the perennial one. Two Maven POMs where one project resolves a dependency and the other does not; a `pom.xml` before and after a dependency upgrade, where the question is which transitive versions moved; two `.csproj` or `web.config` files across environments. These files are long, deeply nested and edited by tooling as often as by people, which is exactly the profile that defeats reading them side by side.

Integration debugging is the second. A SOAP request that the partner accepted and one they rejected; a WSDL from the vendor against the one your client was generated from; a SAML assertion that authenticated against one that did not. In each case the documents are 95% identical and the difference is a single element, an attribute value, or a namespace declaration. Decode first if the payload arrived Base64-encoded with Base64 to XML, format both sides, then compare.

Feeds and exports round it out. Two versions of an RSS or Atom feed to see what a publisher changed; a generated sitemap before and after a deployment; two runs of a data export where a downstream consumer started complaining. Android layouts and other resource XML files fit the same pattern — machine-editable, human-reviewed, and much easier to review as a diff than as two documents.

One thing to be clear about: this is a textual comparison, not a semantic one. It will not tell you that two documents produce the same infoset despite different attribute ordering, and it will not match elements that moved a long way within the document. For those questions you want a real XML-aware differencing tool. For the everyday 'what changed between these two files' question — which is the question almost everyone actually has — normalized text comparison with markup highlighting is faster and easier to read.

XML differences that are noise, and ones that are not

XML gives you several ways to write the same document, and a textual diff reports all of them. Before you start reading a large XML diff, it is worth knowing which reported changes actually change what a parser sees.

Reading an XML diff
Reported differenceDoes it change the parsed document?What to do
Indentation or line breaks between elementsNo — whitespace between elements is insignificantFormat both sides at the same indent first
`<tag/>` versus `<tag></tag>`No — both are an empty elementIgnore
Attribute order within one elementNo — attribute order is not significantIgnore
A different namespace prefix for the same URINo, if the URI matchesCheck the xmlns declaration, then ignore
Whitespace inside a text nodeYes — text content is significantA real change
`&amp;` versus a literal characterNo — the entity resolves to the characterIgnore
A changed comment or CDATA payloadComments no, CDATA yesReview the CDATA, skim the comment
A moved elementYes for sequence-sensitive schemasCheck the schema's ordering rules

Help

Frequently asked questions

Everything you need to know about the XML Diff.

01How is this different from the plain Text Diff?

Only the syntax highlighting, which for markup is worth a lot: element names, attribute names, attribute values and text content are coloured differently, so a change to an attribute value reads differently from a change to an element's text, and a renamed tag stands out from a moved one. The alignment and inline change highlighting are identical to [Text Diff](/text-diff).

02My two documents are semantically identical but the diff is huge. Why?

Because this compares markup, not the parsed infoset, and XML has many ways to write the same thing. One document arrived minified onto a single line and the other is indented; attribute order differs; one uses a `<tag/>` self-closing form where the other writes `<tag></tag>`; namespace prefixes differ even though the namespace URIs match. Run both sides through the [XML Formatter](/xml-formatter) first and most of that noise disappears — a consistent indent on both sides is the single highest-value normalization step for XML diffing.

03Does it understand namespaces, comments and CDATA?

It highlights them correctly and compares them as text, which is usually what you want — a changed comment or a changed CDATA payload is a real change worth seeing. What it does not do is treat two different prefixes bound to the same namespace URI as equivalent, because that is a semantic judgement rather than a textual one.

04Can I use this to compare two SOAP responses?

Yes, and it is a common use — comparing a request that succeeded against one that failed is often the fastest route to the offending element. Format both envelopes first so the comparison is not dominated by whitespace, and expect legitimate differences in message ids, timestamps and any `<ds:Signature>` block. If the response arrived Base64-encoded, decode it with [Base64 to XML](/base64-to-xml) before comparing.

05Is anything uploaded?

No — both documents stay in your browser tab. XML in the wild carries invoices, patient records, financial messages and signed assertions, so this is one of the categories where a server-backed comparison tool is simply not an option. Nothing is transmitted, stored or logged, and the page works offline once loaded.

Keep working

Related tools

Learn the format

Related guides

All guides →