VSCode Extension

Compare XML is also available as a VSCode extension, powered by the same comparison engine as this website. It brings semantic XML comparison into your editor: find what changed between two XML documents, with control over how elements, attributes, values, and repeated child elements are matched.

Installation

Search for Compare XML (publisher: unitstack) in the VSCode Extensions view, or install it from the VSCode Marketplace.

Compare Two XML Documents

  1. Open an XML file.
  2. Run Compare XML: Compare Active Editor with… from the command palette (Ctrl+Shift+P / Cmd+Shift+P) or the editor title menu, then pick what to compare against: another open editor, a file on disk, or the clipboard.
  3. The result opens in VSCode’s native diff editor, with both sides padded so corresponding elements line up — even when whole blocks were added or removed.

You can also right-click a .xml file in the Explorer and choose Select for Compare, then Compare with Selected on the second file — the same flow as VSCode’s built-in file compare.

Difference Navigator

The Compare XML sidebar view groups every difference by kind — Added, Deleted, and Value Changed. Click any entry to jump straight to that difference in the diff editor.

From the sidebar’s title bar you can also:

  • Configure Comparison Options — open the options picker.
  • Swap Sides — swap base and contrast.
  • Clear Results — end the current comparison session.

Comparison Options

The extension shares the same semantic options as the web app. Configure them per comparison with the Compare XML: Configure Comparison Options command, or set workspace defaults in settings.json:

SettingDefaultDescription
compare-xml.arrayCompareMethodbyIndexHow repeated child elements are compared: byIndex, lcs (minimal diff), or unordered (multiset match).
compare-xml.keyCaseInsensitivefalseIgnore case when matching element and attribute names.
compare-xml.valueCaseInsensitivefalseIgnore case when comparing text and attribute values.

See Array Comparison Methods and Comparison Options for details on what each option does.