Getting Started

Comparing two XML documents is a common task when reviewing configuration changes, API responses, or data transformations. This guide walks you through the entire process using Compare XML — from entering your data to reading the results.

Paste or Upload Your XML

Open Compare XML and paste the two XML documents you want to compare into the Base and Contrast editors. You can also drag and drop a .xml file or load XML from a URL.

Choose Comparison Options

Before comparing, pick the options that match your data:

  • Array comparison method: By Index, LCS, or Unordered.
  • Ignore key case: Treat Name and name as the same element or attribute name.
  • Ignore value case: Treat text and attribute values case-insensitively.

Run the Comparison

Click the Compare button. The tool parses both inputs, normalizes whitespace, and recursively compares the XML tree structure.

Understanding the Results

After running a comparison, Compare XML presents differences in a structured, color-coded view.

Added Nodes

Nodes that exist in the Contrast side but not in the Base side are shown in green. These represent new elements, attributes, or text content.

<!-- Base -->
<user>
  <name>Alice</name>
</user>

<!-- Contrast -->
<user>
  <name>Alice</name>
  <email>[email protected]</email>
</user>

With this example, the <email> element is reported as added.

Deleted Nodes

Nodes that exist in the Base side but were removed in the Contrast side are shown in red.

Value Changed

When a text value or attribute exists on both sides but differs, it is marked in yellow. This includes changes to element text, attribute values, or repeated child elements.

<!-- Base -->
<user status="active">Alice</user>

<!-- Contrast -->
<user status="inactive">Alice</user>

The status attribute change is reported as a value change.

Result Sidebar

The sidebar on the result page groups differences by category and full XML path. Click any entry to jump directly to the corresponding location in the diff.