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.
Try Next
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.
Related Tools
JSON → CSV
Convert an array of JSON objects to CSV online. Headers are inferred automatically from all keys across records.
CSV → JSON
Convert CSV data to a JSON array of objects online. Auto-detects delimiter and quotes, preserves numeric types when requested.
Number Base
Convert numbers between binary, octal, decimal, and hexadecimal. Supports arbitrarily large integers using BigInt.
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 → YAML
Convert JSON to YAML online. Preserve structure, comments-free, and ready to paste into Kubernetes or CI configs.