1. Home
  2. Windows Tips
  3. Compare two source codes and text files in notepad with compare

Compare Two Source Codes And Text Files In Notepad++ With Compare

Notepad++ is considered to be one of the best extensible text source editing application. It not only offers a wide range of native add-ins but supports third-party plugins as well, allowing users to further extend its functionality by including new features. We have previously reviewed a brilliant HTML tag finding plug-in for Notepad++ called HTML Tag. Today, we will look at another simple yet powerful plug-in for Notepad++ called Compare. Since its first release in 2007, Compare has been consistently updated with new features and improvements. For those who never tried it before, it’s the ability to compare two source code and plain text files opened in Notepad++ tabs. While it allows you to customize the comparison method, you can also toggle some of its markers on/off which show differences between text files in focus.

Compare is a highly customizable application in terms of changing the text matching criteria. You can defined favorite set of text highlighting colors for line addition, deletion, and line moved and line changed to easily scan the differences between the document. Just like MS Word 2010 Compare feature, it supports synchronous vertical and horizontal scrolling which enables you to scroll through both text files simultaneously. You can either install Compare from Notepad++ Plug-in Manager or move the downloaded package to Notepad++ Plugins folder to install it.

plugin manager 1

Once installed, open source code or text files which you want to compare. Now select Compare option from Compare in Plugins menu, which will open both text files side by side with synchronous vertical and horizontal scrolling enabled. Compare adds a Nav Bar at right side of the window. The Nav Bar shows the portions of both files in different color to let users distinguish the differences. If synchronous scrolling doesn’t work, make sure that both Horizontal and Vertical synchronous scrolling options are enabled in toolbar.

compare plugin 1

Green add markers are added alongside those lines in text file which aren’t present in other text document. Matching criteria can be changed from Compare menu. If you’ve been working on different versions of documents, you can quickly compare current version with last save in order to quickly know about all the changes.

plugins compare 3

The Option button opens color configurator, where you can change marking colors of line added, deleted, moved, changed, empty line, and change highlight and set highlight transparency.

compare options 4

Compare is great alternative for text comparison tools which work as standalone application to compare text and programming language source code files. Compare works with all versions of Notepad++. Testing was done with Notepad++ version 5.9.3 running on Windows 7 64-bit system.

Download Compare for Notepad++

15 Comments

  1. Can we create a similar software application neural network technology? A neural network software that compares two documents. Has anyone done that yet?

  2. Comparing is nice, but it is practically useless if it is only a visual feature. After comparison, how do I copy out those compared lines which a) appear only in the first file, b) appear only in the second file, c) appear in both files? Like the Unix/Linux equivalent of “comm -12 file1 file2” (Print only lines present in both file1 and file2).

  3. Is there any simple way to copy whole lines / text blocks between two compared files?

  4. nice tool… but how do I close the compare view and keep the files open? it is really annoying to close a file just to close the compare and then open it again.

    • When you want to close the compare view, click on “Plugins”, hover over “Compare”, and click “Clear results”.

    • Doesn’t work for me: stuck with two windows; half my files open in one pane, the others in the 2nd pane; have to use a split bar to determine which “pane” I’m looking at.

  5. thanks for pointoing out the plugin manager… some websites list deprecated solutions 🙁 Compare plugin is awesome 🙂

  6. Thanks for pointing out this great plugin, this is a big time saver!