XML Diff — Structural Compare of Two XML Documents
Compare two XML documents structurally — elements, attributes, and text content. Ignores comments, whitespace, and attribute order. Uses the same path convention as our XML → JSON converter (@attr, #text). 100% local.
Last updated:
CommentsPath convention: attributes are shown as @attr, text content as #text — same as our XML → JSON converter, so paths can be pasted into other JSON tools.
| Change | Path | Left | Right |
|---|---|---|---|
| Changed | $.invoice["@currency"] | "USD" | "EUR" |
| Changed | $.invoice.customer.name | "Ada Lovelace" | "Ada King" |
| Changed | $.invoice.items.item[0].price | "19.99" | "17.50" |
| Changed | $.invoice.items.item[1].price | "49.00" | "45.00" |
| Added | $.invoice.items.item[2] | — | {"@sku":"C9","qty":"3","price":"5.00"} |
| Changed | $.invoice.total | "88.98" | "95.00" |
Frequently Asked Questions
How does the tool handle attribute order and whitespace?
Attributes are compared as an unordered set (attribute order in XML has no semantic meaning). Whitespace between tags is normalized. Only meaningful content differences — element added/removed, attribute value changed, text content changed — are reported.
What is the path syntax in the results?
It matches our XML → JSON conversion. Attributes appear as @attr, text nodes as #text, elements as their tag names. So $.invoice["@currency"] means the currency attribute on the top-level invoice element. You can paste any path into other JSON-focused tools without translation.
Are XML namespaces handled?
Namespaced tags are compared using their full prefixed name (e.g. soap:Envelope). If you only care about local names, strip the namespace prefixes in a formatter before diffing.
Related Tools
JSON → TypeScript
Convert JSON to TypeScript interfaces instantly. Generate strongly-typed TS types from any JSON sample.
JSON → Go
Convert JSON to Go structs online. Generates idiomatic Go structs with proper json tags and PascalCase field names.
JSON → Python
Convert JSON to Python @dataclass definitions with typed fields. snake_case field names, nested classes, List[T] for arrays, and JSON-key alias comments. 100% local.
JSON → PHP
Convert JSON to PHP 7.4+ classes with typed properties. Generates one class per nested object, phpdoc @var array<T> for typed arrays, and camelCase property names. 100% local.
JSON → Java
Convert JSON to Java POJOs with Jackson @JsonProperty annotations, camelCase field names, List<T> for arrays, and generated getters/setters. Optional package declaration. 100% local.
JSON → C#
Convert JSON to C# classes with System.Text.Json [JsonPropertyName] attributes, PascalCase properties, List<T> for arrays, and optional namespace. Works in .NET 6 / 7 / 8 / 9. 100% local.