195

I need a tool to compare 2 binaries. The files are quite large. Some freeware or trial tools I found on the Internet are not convenient to use for large files. Can you recommend me some tools?

G. Ciardini
  • 1,210
  • 1
  • 17
  • 32
mustafa
  • 3,605
  • 7
  • 34
  • 56

6 Answers6

241

If you want to find out only whether or not the files are identical, you can use the Windows fc command in binary mode:

fc.exe /b file1 file2

For details, see the reference for fc

Jason
  • 9,408
  • 5
  • 36
  • 36
Mike Woinoski
  • 3,123
  • 1
  • 16
  • 15
  • 2
    for the same purpose - only whether files are identical or not - a portable app Duplicate File Finder works good enough. Particularly for big files like .iso files. – RuntimeException Oct 14 '15 at 14:03
  • 14
    this should be the accepted answer, since this is windows native and not an addition 3rd party app – LilaQ May 09 '17 at 00:31
  • 2
    this just shows a list of bytecodes - there is also a "comp" tool in the command-line, but that one seems to require files to be of same size – George Birbilis Jan 10 '18 at 10:26
133

A few possibilities:

See also: https://web.archive.org/web/20151122151611/https://stackoverflow.com/questions/688504/binary-diff-tool-for-very-large-files

mgutt
  • 5,867
  • 2
  • 50
  • 77
Polynomial
  • 27,674
  • 12
  • 80
  • 107
  • 4
    I read in the notes of vBinDiff that "unlike diff, it works well with large files (up to 4 GB)." So its suitability for working with large files depends on your definition of "large". Also, I found it would mysteriously not start up under windows 7 x64. – intuited Aug 21 '12 at 19:15
  • 34
    Bare in mind that VBinDiff is a CLI program, so if you just try to run it on Windows, it will either appear not to start, or will very briefly show a command prompt window, which quickly disappears. Open up a command prompt and run the program from there to see what arguments it accepts, and then use it from the command prompt accordingly. – nonoitall Oct 14 '12 at 00:37
  • 2
    vBinDiff works fine for me in Windows 7 x64. – plasticinsect Mar 15 '13 at 18:23
  • When I tried using vBinDiff to compare two 1.4 GB files, it croaked. Neither can WinDiff handle such files. – ThreeBit Apr 25 '13 at 08:17
  • @intuited I too found this quite humorous, although I found that it does work with files larger than 4 GB -- you just can't see diffs past 4 GB. That was enough for my purposes, although it would be great to have true LFS. – pattivacek Mar 25 '15 at 16:10
  • Anyone know were we can get WinDiff from? The link is just to the wikipedia page. There's a link to XPsp2 support tools there (which includes it), but that will only install on XP. – UpTheCreek Oct 16 '15 at 11:48
  • VBinDiff is AWESOME! Thought it is CLI, it is easy to use! Except maybe I had to search what RET key is xD It turns that it is the Enter key. – Ghasan غسان Dec 06 '15 at 02:49
  • 4
    vBinDiff doesn't seem to deal with inserted bytes at all, so it's really not much better than HxD except that it shows you all the changes in red. – endolith Feb 11 '16 at 21:13
  • 1
    VBinDiff allows you to freeze one of the two scroll areas and when you make them sync again by scrolling the other one byte at a time it shows the same parts in white and diffs in red. So it is more of a manual tool, but with visual aid – George Birbilis Jan 10 '18 at 10:25
25

Total Commander also has a binary compare option: go to: File \\Compare by content

ps. I guess some people may alredy be using this tool and may not be aware of the built-in feature.

endolith
  • 25,479
  • 34
  • 128
  • 192
Dimitry K
  • 2,236
  • 1
  • 28
  • 37
19

My favorite "swiss knife" is Beyond Compare from http://www.scootersoftware.com/

Boris Ivanov
  • 4,145
  • 1
  • 32
  • 40
15

I prefer to use objcopy to convert to hex, then use diff.

BobC
  • 1,978
  • 3
  • 24
  • 26
  • 4
    Useful answer. The output file size is about 3 times as big as the input file. This command will convert a binary file to hex. `objcopy -I binary -O ihex ` – evpo Sep 23 '15 at 00:27
12

In Cygwin:

$cmp -bl <file1> <file2>

diffs binary offsets and values are in decimal and octal respectively.. Vladi.

Vladi
  • 464
  • 4
  • 6