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
- 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.
| Reported difference | Does it change the parsed document? | What to do |
|---|---|---|
| Indentation or line breaks between elements | No — whitespace between elements is insignificant | Format both sides at the same indent first |
| `<tag/>` versus `<tag></tag>` | No — both are an empty element | Ignore |
| Attribute order within one element | No — attribute order is not significant | Ignore |
| A different namespace prefix for the same URI | No, if the URI matches | Check the xmlns declaration, then ignore |
| Whitespace inside a text node | Yes — text content is significant | A real change |
| `&` versus a literal character | No — the entity resolves to the character | Ignore |
| A changed comment or CDATA payload | Comments no, CDATA yes | Review the CDATA, skim the comment |
| A moved element | Yes for sequence-sensitive schemas | Check 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
Text Diff
Text Tools
YAML Diff
Text Tools
XML Formatter
Re-indent any XML document into clean, readable markup — comments and CDATA preserved, validation built in.
JSON Compare
Side-by-side JSON diffing with VS Code's engine — highlighted changes, editable panes, and key-order-insensitive comparison.
String Utility
Text Tools
XML Editor
A full VS Code editing experience for XML — highlighting, folding, find & replace, validation, and tree view in one place.