diffoscope will try 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.
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!
Firefox extensions compared (HTML output)
Debian packages compared (text output)
… and more examples on tests.reproducible-builds.org.

Command-line interface
Text and HTML ouput
Supported file formats: Android APK files, Android boot images, Berkeley DB database files, ColorSync colour profiles (.icc), Coreboot CBFS filesystem images, Dalvik .dex files, Debian .buildinfo files, Debian .changes files, Debian source packages (.dsc), Device Tree Compiler blob files, ELF binaries, FreeDesktop Fontconfig cache files, FreePascal files (.ppu), GHC Haskell .hi files, GIF image files, GNU R Rscript files (.rds), GNU R database files (.rdb), Gettext message catalogues, Git repositories, Gnumeric spreadsheets, Gzipped files, ISO 9660 CD images, JPEG images, JSON files, Java .class files, JavaScript files, LLVM IR bitcode files, MacOS binaries, Microsoft Windows icon files, Microsoft Word .docx files, Mono ‘Portable Executable’ files, Ogg Vorbis audio files, OpenOffice .odt files, OpenSSH public keys, OpenWRT package archives (.ipk), PDF documents, PGP signed/encrypted messages, PNG images, PostScript documents, RPM archives, Rust object files (.deflate), SQLite databases, SquashFS filesystems, TrueType font files, XML binary schemas (.xsb), XML files, XZ compressed files, ar(1) archives, bzip2 archives, character/block devices, cpio archives, directories, ext2/ext3/ext4/btrfs filesystems, statically-linked binaries, symlinks, tape archives (.tar), tcpdump capture files (.pcap) and text files.
Fallback on hexdump comparison
Fuzzy-matching to handle renamings
… and many more!
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
On Fedora based systems:
dnf install diffoscope
On Arch Linux:
pacman -S diffoscope
On Homebrew:brew install diffoscope
Through Git:
git clone https://salsa.debian.org/reproducible-builds/diffoscope.git
diffoscope is developed within the “Reproducible builds” effort.
#reproducible-builds and/or #debian-reproducible on OFTCExtending diffoscope to support new formats is quite straightforward in most cases. It also has a comprehensive test suite. Patches welcome!
pkg-diff.sh from Open Build Service build-compare
diffoscope is free software licensed under the GNU General Public License version 3 or later.
Lunar, Reiner Herrmann, Chris Lamb, Helmut Grohne, Holger Levsen, Mattia Rizzolo, Daniel Kahn Gillmor, Paul Gevers, Peter De Wachter, Yasushi SHOJI, Clemens Lang, Ed Maste, Joachim Breitner, Mike McQuaid. Baptiste Daroussin, Levente Polyak, Ximin Luo, Maria Glukhova, Daniel Shahaf, Juliana Oliveira Rodrigues.