About Online XML Compare
XML Compare finds the differences between two XML documents. Use it to see what changed between two SOAP responses, a configuration file before and after an edit, or two exports of the same data.
- Compare two XML documents side by side
- Highlight added, removed and changed lines
- Highlight the changed characters inside a line
- Ignore indentation, line breaks and blank lines
- Compare CDATA sections and comments as typed
- Mark XML syntax errors as you type
- Show the first parse error
- Free to use
What is an XML diff?
An XML diff shows what changed between two XML documents: elements added or removed, attribute values changed, text changed. A plain text diff also reports indentation and line breaks, so the same document saved by two programs can differ on every line. XML Compare formats both documents first, and only changes to the content remain.
How to compare two XML files online?
Paste the contents of the original file into the Original XML field and the contents of the modified file into the Modified XML field. The differences appear below, the original on the left and the modified XML on the right. If either document is not valid XML, you get the parse error instead.
How does XML Compare work?
Both documents are checked with the same XML validator as the XML Formatter. Then the whitespace between tags is removed, and each document is laid out with 4-space indentation, one element per line. The two copies are compared line by line, and inside each changed line, character by character. Nothing is sent to a server: the comparison runs in your browser.
XML Compare Example
Below are two versions of an order. The second is written on one line, its status has changed, the B200 item is removed and a tracking number is added.
XML Compare shows three differences: Status changed from Pending to Shipped, the B200 item removed, and Tracking added. Writing the document on one line makes no difference.
What counts as a difference?
XML Compare ignores formatting, not order: elements and attributes are compared in the order they are written.
- Indentation, line breaks and blank lines between elements do not count.
- The order of elements counts: <a/><b/> and <b/><a/> differ.
- The order of attributes counts: <a x="1" y="2"/> and <a y="2" x="1"/> differ.
- Several spaces in a row inside element text count as one space.
- CDATA sections and comments are compared as typed.
Online XML Formatter
To format one XML document and check it for errors, use the XML Formatter.
Online JSON Compare
To compare two JSON documents with the key order ignored, use the JSON Compare.