diffoscope

In-depth comparison of files, archives, and directories.





diffoscope tries to get to the bottom of what makes files or directories different. It will recursively unpack archives of many kinds and transform various binary formats into more human-readable form to compare them. It can compare two tarballs, ISO images, or PDF just as easily.

Latest release: 160 (11 Sep 2020)





You can try it now using Docker:

echo foo > file1 echo bar > file2 docker run --rm -t -w $(pwd) -v $(pwd):$(pwd):ro \ registry.salsa.debian.org/reproducible-builds/diffoscope file1 file2

… or try it on try.diffoscope.org!

News

(RSS)

Examples

Firefox extensions compared (HTML output)

Debian packages compared (text output)

… and more examples on tests.reproducible-builds.org. You can also view an demonstration interactive shell session (220K).

Features

Command-line interface

Text and HTML ouput

File formats supported include: Android APK files, Android boot images, Apple Xcode mobile provisioning files, ar(1) archives, Berkeley DB database files, bzip2 archives, character/block devices, ColorSync colour profiles (.icc), Coreboot CBFS filesystem images, cpio archives, Dalvik .dex files, Debian buildinfo files, Debian .changes files, Debian source packages (.dsc), Device Tree Compiler blob files, directories, ELF binaries, ext2/ext3/ext4/btrfs/fat filesystems, FreeDesktop Fontconfig cache files, FreePascal files (.ppu), Gettext message catalogues, GHC Haskell .hi files, GIF image files, Git repositories, GNU R database files (.rdb), GNU R Rscript files (.rds), Gnumeric spreadsheets, GPG keybox databases, Gzipped files, Hierarchical Data Format database, ISO 9660 CD images, Java .class files, Java .jmod modules, JavaScript files, JPEG images, JSON files, LLVM IR bitcode files, LZ4 compressed files, MacOS binaries, Microsoft Windows icon files, Microsoft Word .docx files, Mono ‘Portable Executable’ files, Mozilla-optimized .ZIP archives, Multimedia metadata, OCaml interface files, Ogg Vorbis audio files, OpenOffice .odt files, OpenSSH public keys, OpenWRT package archives (.ipk), PDF documents, PE32 files, PGP signatures, PGP signed/encrypted messages, PNG images, PostScript documents, Public Key Cryptography Standards (PKCS) files (version #7), RPM archives, Rust object files (.deflate), SQLite databases, SquashFS filesystems, symlinks, tape archives (.tar), tcpdump capture files (.pcap), text files, TrueType font files, WebAssembly binary module, XML binary schemas (.xsb), XML files, XZ compressed files, ZIP archives and Zstandard compressed files.

Fallback on hexdump comparison

Fuzzy-matching to handle renamings

… and many more!

Get diffoscope

Try it online!

Via pip :

pip install diffoscope

Note: You might still want to install Python modules from tlsh and rpm and other external tools to get more meaningful results. Use diffoscope --list-tools to get the full list.

On Debian and derivatives:

apt install diffoscope

Via Docker:

docker run --rm -t -w $(pwd) -v $(pwd):$(pwd):ro registry.salsa.debian.org/reproducible-builds/diffoscope

On Fedora based systems:

dnf install diffoscope

On Arch Linux:

pacman -S diffoscope

On FreeBSD based systems:

pkg install py36-diffoscope

On OpenBSD based systems:

pkg_add diffoscope

On Homebrew:

brew install diffoscope

Source tarballs

Through Git:

git clone https://salsa.debian.org/reproducible-builds/diffoscope.git

Contribute

diffoscope is developed within the “Reproducible builds” effort.

Extending diffoscope to support new formats is quite straightforward in most cases. It also has a comprehensive test suite. Patches welcome!

Similar software

License

diffoscope is free software licensed under the GNU General Public License version 3 or later.

Contributors

Alexis Murzeau, anthraxx, Baptiste Daroussin, Ben Hutchings, beuc@beuc.net, Brett Smith, Ceridwen, Chris Lamb, Clemens Lang, Daniel Fullmer, Daniel Kahn Gillmor, Daniel Shahaf, Dhole, Ed Maste, Eli Schwartz, Emanuel Bronshtein, Esa Peuha, Frazer Clews, Graham Christensen, Guangyuan Yang, Helmut Grohne, Holger Levsen, HW42, James Clarke, Jean-Romain Garnier, Jelle van der Waa, Joachim Breitner, Juliana Oliveira, Juliana Oliveira Rodrigues, Juliana Rodrigues, Jérémy Bobbio, klemens, Marc Herbert, Marek Marczykowski-Górecki, Maria Glukhova, Marius Gedminas, Mattia Rizzolo, Michael Osipov, Michel Messerschmidt, Mike Hommey, Mike McQuaid, Milena Boselli Rosa, Paul Gevers, Paul Wise, Peter De Wachter, Rainer Müller, Reiner Herrmann, Ricardo Gaviria, Santiago Torres-Arias, Satyam Zode, siamezzze, Vagrant Cascadian, Vibhu, Will Thompson, Xavier Briand, Ximin Luo, and Yasushi SHOJI.