Compare XML Online

Use our free online XML diff to perform a semantic comparison between two XML documents. Get a glimpse of what SemanticDiff can do.

How to use

To compare two XML files with our our free online tool, just follow these steps:

  1. Use Copy & Paste or click Load File to load the documents you want to compare
  2. If the XML data is difficult to read (e.g. contains no line breaks), click the Prettify buttons
  3. Click Compare

You should now see a side-by-side comparison of the XML elements and attributes. The diff still shows the original data you entered, but the two documents are now aligned with each other. Red and green highlighting helps you see where the data differs.

Tags or attributes that are only present in the left document are highlighted in red while data that is unique to the right data set is highlighted in green.

If there is a lot of overlap between the two versions of your XML documents, identical areas are excluded from the diff to help you focus on the actual changes.

Check out our documentation to learn more.

How it works

The tool compares XML elements and attributes by first parsing them into a data structure that is independent of their textual representation. This helps us ignore changes that are unrelated to the encoded values, such as adding whitespace between attributes.

Additional rules are applied to filter out changes that do not modify the semantics of the values, such as reordering attributes within the same element or switching the value encoding to CDATA.

Afterwards, the remaining changes are mapped back to the text you inserted to highlight the modifications. Unlike most other online XML diff tools, our tool does not reformat your XML input. This should help you locate the changes in the original input. If you like, you can still reformat your input using the Prettify buttons before diffing.

Please note: Our comparison tool may handle whitespace differently.

The XML specification treats all whitespace as relevant, but most applications strip leading and trailing whitespace from values (text within elements) to give you more freedom in formatting your XML documents. Our diff does the same to avoid unnecessary noise in the comparison. You can override this behavior by adding the xml:space="preserve" attribute to the root elements of your documents before comparing them.

Offline usage

Our online XML diff tool requires an internet connection to work because the computation is performed on our servers. If you are looking for a semantic XML comparison that works offline, you may want to check out our SemanticDiff Visual Studio Code extension. It can not only compare XML files but also supports various other programming languages and data formats. The extension performs all computations locally, so your data never leaves your machine.