Arrow

Free Windows application to compare differences between files and folders

First published on February 20, 2009

If you work with different versions of files, you often need to compare them to see what has changed between files and to merge changes if necessary. This is especially important if you are working with code. Aside from creating word processor documents (and then using the “compare and merge” functionality) or using a command line diff, there are a couple of good Windows applications to make file comparisons of code more user friendly.

Beyond Compare, which is available for both Windows and Linux, costs $30 and does a really good job. (Note: you can try it out for free for 30 days.) One really good thing that it has is a Windows Explorer context menu, where you can right-click on a file, select it as the “left side” of the compare operation, then browse to another file, right-click on that one, and select it as the “right side” of the compare operation. This automatically launches the comparison window and integrates very nicely into regular file browsing processes.

On the completely free side of things, WinMerge is a program that does all of the standard operations well except for the right-click context menu behavior above (and maybe it will soon have such functionality). Instead, the only option is to launch the program for the “left side” file, and then use the browse interface from within WinMerge to select the “right side” file. For most people, this is probably something they can live with.

WinMerge and Beyond Compare context-menu integration

WinMerge has a really simple interface, similar to Beyond Compare, which does all of the major file / code comparison operations you would expect.

WinMerge main pane

  • There is a left pane showing coloured lines representing which areas in the files are different.
  • The main pane is split into the left and right sides representing the two files, so that you can easily scroll through both files simultaneously and synchronously.
  • There are buttons to copy lines from one side to the other.
  • You can type directly into either side to edit the files.
  • The bottom panes show close-ups of the differences.

You can also start with a blank slate (without selecting any files) and type or copy and paste arbitrary text into either side.

WinMerge has a lot of useful options, such as configurable colours and fonts, options on how to treat certain formatting of code such as blank lines, integration with TortoiseSVN, a patch file generator, and more.

Both WinMerge and Beyond Compare can also compare entire folders. The screenshot below shows WinMerge’s folder compare, which points out which files are different, as well as which files are present in only one of the two folders.

WinMerge folder compare

Thanks to Angelo for another great tip!

Arrow

5 Responses to “Free Windows application to compare differences between files and folders”


  1. Lex Robin says:

    Does WinMerge supports editing the files which are compared? Or is it just a static viewer?


  2. Peter says:

    Hi Lex, you can edit the files that are being compared within WinMerge itself.


  3. Derek says:

    You can actually launch WinMerge with both sides loaded just by having the two files that you want to compare selected in explorer before using the context menu. This works for folders and files.

    Also, you can darg and drop folders into the WinMerge "select folders / files" dialog, which is handy. Another feature I really appreciate about WinMerge is that if you "Browse…" in the select files or folders dialog, it will actually start browsing at whatever path you currently have in there.

    Because of those minor attentions to detail, WinMerge is probably one of the most useful apps I use on a day-to-day basis. It’s one free app that I would not hesitate paying money for.


  4. Miguel says:

    I have just discovered that WinMerge also has a plug-in for comparing MS Office and other popular binary file formats. Just go to the WinMerge site and click on the Plug-ins tab.

    Useful for a comparison purposes, especially for EXCEL files. Have not tried it yet for editing yet (to see if format will be preserved).

    The underlying xdocs2txt utility may also come in handy for programming purposes.


  5. Dan says:

    I use WinMerge all the time; in the right-click context menu, there are two entries: "Compare To" and "Compare…". These correspond to the "left" and "right" files that were referred to in the original article.

    Back in the day, I used to use WinDiff (may be dating myself a bit here LOL), and I think that was one of the first file compare tools for Windows.

    WinMerge does an outstanding and of course affordable job at comparing repository versions of files; better than the default Microsoft Visual Source Safe comparison tool…

    @Miguel:
    Thanks for the plug-in info for WinMerge. I’m headed there next to scope it out…

Speak your mind

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word