xmldiff is a Python library and command-line utility for comparing XML documents structurally instead of line by line.
It’s designed for hierarchical markup where ordinary text diffs are hard to read, and it can generate edit scripts or marked-up output that shows how one XML tree changes into another. The project can diff XML files, strings, and lxml trees, and it also provides patching functions and commands so generated diffs can be applied back to XML documents.
This is free and open source software.
Key Features
- Provides separate
xmldiffandxmlpatchcommands for generating and applying XML diffs. - Supports configurable matching behaviour with thresholds, unique attributes, ignored attributes, ratio modes, and fast matching options.
- Can return edit scripts or formatter-generated output depending on the workflow.
- Includes formatter support for whitespace normalization and XML-marked diff output.
- Can produce more useful visual diffs for formatted XML or HTML content by distinguishing text changes from formatting changes.
- Works with modern Python versions and uses
lxmlas its runtime dependency.
Website: github.com/Shoobx/xmldiff
Support:
Developer: Shoobx
License: MIT License

xmldiff is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| Terminal-Based Diff Tools | |
|---|---|
| difftastic | Structural diff tool that compares files based on their syntax |
| diff-so-fancy | Attractive diffs with diff-highlight and more |
| delta | Viewer for git and diff output |
| icdiff | An improved colored diff |
| diffoscope | In-depth comparison of files, archives, and directories |
| colordiff | Wrapper for diff with pretty syntax highlighting |
| diffsitter | Semantic diff tool |
| objdiff | Local diffing tool for decompilation project |
| ydiff | Tool to view colored, incremental diff in a version controlled workspace |
| diffr | Word-by-word diff highlighting utility |
| dyff | diff tool for YAML files |
| Wdiff | Wordwise implementation of diff |
| dwdiff | diff program that operates at the word level |
| oyo | Step-through diff viewer |
| diffyml | Compares YAML documents by their structure |
| diff2html-cli | Generate HTML diffs |
| biodiff | Terminal-based binary diff viewer |
| dirdiff | Compute the differences between two directories |
| csvdiff | Fast diff tool for comparing CSV files |
| VBinDiff | Visual binary diff |
| riff | Wrapper around diff |
| csv-diff | Diffing CSV and JSON files |
| xmldiff | Compare XML documents |
| vbl | Terminal-based hexadecimal viewer |
| Patdiff | File diff using the Patience Diff algorithm |
| dead-ringer | Binary diff utility |
| sesdiff | Generates a shortest edit script |
| semdiff | Semantic diff tool written in Rust |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.