XML Compare
Compare two XML documents
What Is This Tool?
The XML Compare tool parses two XML documents, normalizes them into a consistent indented form (sorted attributes, collapsed whitespace), and then runs a line-by-line diff to show exactly what was added, removed, or changed between them. This makes it easy to spot real structural and content differences between two XML files without being distracted by formatting-only variation. Everything runs locally in your browser.
How to Use
Paste the original XML into the first box.
Paste the modified XML into the second box.
Click Compare to see every added and removed line.
Features
- Normalizes both documents before comparing, so indentation and attribute order don't cause false differences
- Line-by-line diff with clear added / removed highlighting
- Reports invalid XML separately for the original or modified document
- Added / removed line counts summary
- 100% client-side — nothing leaves your browser
Examples
Original:
<item id="1"><price>9.99</price></item>
Modified:
<item id="1"><price>12.99</price></item>
Diff result:
- <price>9.99</price> + <price>12.99</price>
Common Use Cases
- Comparing two versions of an XML config or feed file
- Reviewing SOAP/XML API response changes between environments
- Checking whether an XML transformation preserved the intended content
- Auditing changes to XML-based data exports
Frequently Asked Questions
Does attribute order matter?
No, attributes are sorted alphabetically before comparing, so reordering attributes on an element will not show up as a difference.
Does whitespace-only formatting count as a difference?
No, both documents are re-indented into the same normalized format before comparing, so indentation and line-wrapping differences are ignored.
What happens if one of my documents is not valid XML?
The tool tells you specifically whether the Original or Modified document failed to parse, along with the underlying error message, so you can fix it before comparing.
Are XML comments compared?
Yes, comments are included in the normalized output and will show up as added or removed lines if they differ.
Is my data uploaded anywhere?
No. The comparison happens entirely in your browser using JavaScript. Nothing is sent to a server.
Can I copy the diff result?
Yes, click Copy to copy the full diff as plain text to your clipboard.