Command Palette

Search for a command to run...

XM

XML Diff Checker

Compare two XML documents structurally and see which elements, attributes, and text values were added, removed, or changed, by node path rather than by line. 100% client-side.

What is the XML Diff Checker?

An XML diff checker compares two XML documents and reports what changed as a set of structural differences: which elements were added or removed, which attributes changed value, and where the text content differs. Instead of a line-by-line text diff that turns red the moment you reformat or reorder something, it parses both documents into node trees and compares them as data. You paste the original XML on the left, the new XML on the right, and get a list of differences, each pinned to the exact node path where it occurred, such as /catalog/book[1]/@category.

The reason a structural comparison matters is that XML carries the same meaning across many different byte layouts. Two documents can be identical in structure yet differ in indentation, attribute order, line endings, or whether an empty element is written as a self-closing tag. A plain text diff flags all of those as changes; a structural diff ignores them and reports only what would change how a parser reads the document. This tool pairs child elements of the same tag name by their order of appearance, so the second book element is compared to the second book element even if unrelated siblings shifted around it.

Everything runs in your browser with a tolerant parser that handles attributes in single or double quotes, self-closing tags, CDATA sections, comments, processing instructions, and standard entity references. The documents never leave your device, are never uploaded, and are never logged, which matters because the XML people compare is often a configuration file, an API payload, a sitemap, or an SVG. Malformed input is reported with a clear message rather than a silent wrong answer, and the tool keeps working with your network disconnected once the page has loaded.

The sample shows what this XML diff checker reports. Click Load Sample, then Compare, and the summary reads 1 added, 0 removed and 2 changed. The first book's category attribute is listed at /catalog/book[1]/@category, from fiction to mystery, its price text at /catalog/book[1]/price/text(), from 12.99 to 14.99, and the new isbn element at /catalog/book[2]/isbn. The unchanged title and author elements do not appear at all, and neither would a change in indentation. That node path is what you search for when you open the file to make the fix.

How to use the XML Diff Checker?

  1. Paste both XML documents

    Put the original XML in the first field and the changed XML in the second. Load the sample if you want to see how added elements, removed attributes, and changed text are reported.

  2. Choose comparison options

    Leave "ignore whitespace" on so reformatting does not count as a change, and optionally ignore attributes or compare names and values case-insensitively.

  3. Compare the documents

    Press Compare. The tool parses both trees and lists every difference by node path, grouped into added, removed, and changed, with the old and new values shown side by side.

  4. Review and export the report

    Filter by change type, inspect each element, attribute, or text difference at its path, then copy or download the full report to paste into a pull request or ticket.

Key Features

  • Structural, not line-based

    Documents are parsed into node trees and compared as data, so reindenting, reordering attributes, or rewrapping lines does not register as a change. Only real structural differences are reported.

  • Node-path pinpointing

    Every difference is labelled with the exact path where it occurred, such as /catalog/book[2]/price/text(), so you can find and fix the change without scanning the whole file.

  • Element, attribute, and text detection

    The diff separates added and removed elements from changed attribute values and altered text content, so you can see at a glance which kind of change happened where.

  • Order-aware child matching

    Repeated elements of the same tag are paired by their order of appearance, so the third item is compared to the third item and unrelated siblings do not shift the whole diff.

Frequently Asked Questions

Paste the original XML into the first field and the changed XML into the second, then press Compare. The tool parses both into node trees and lists every added, removed, and changed element, attribute, and text value, each pinned to its node path. Nothing is uploaded.

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!

xml diffcompare xml filesxml comparediff two xml documentsxml comparison toolxml change detectionstructural xml diffcompare xml onlinexml difference checkerxml diff checkercompare xml by node path