How can I compare text files in Windows?

Some Windows machines come with a basic comparison tool from Microsoft named windiff.exe. If your machine doesn’t already have WinDiff, it can be found in the Windows XP Service Pack 2 Support Tools.

A more robust alternative is the Open Source WinMerge.

“WinMerge is an Open Source visual text file differencing and merging tool for Win32 platforms. It is highly useful for determing what has changed between project versions, and then merging changes between versions.”

You can find WinMerge at

In addition to those dedicated compare tools, Notepad++ ( has a compare feature as one of its plugins (it comes bundled initially).

Another option is Cygwin (, a project who’s aim is to provide “a Linux-like environment for Windows”. It provides textual analysis applications like head, tail, grep and diff. You can use diff to compare two files, or multiple files in a directory, or recursively compare two directories (not for the faint of heart!). It also works well with other open source applications that work on windows, like emacs which you can use to see a nice visual colorful representation of the differences!

comp is more for checking if two files are identical, rather than seeing the differences If everything fails, there’s a built-in command called “comp”. Type “comp /?” at the command prompt to see how to use it.

There is also a DOS command ‘fc’ which will show you lines that mismatch, type “fc /?” at the command prompt to see how to use it.