Fork me on Salsa

diffoscope

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

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!

Examples

Example of diffoscope HTML output

Firefox extensions compared (HTML output)

Example of diffoscope text output

Debian packages compared (text output)

… and more examples on tests.reproducible-builds.org.

Demo

Features

  • 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!

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

  • On Fedora based systems:
    dnf install diffoscope

  • On Arch Linux:
    pacman -S 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

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.