How to compare files using notepad++

Notepad++ is not merely a text editor. If you are a programmer, you can use it to write your programming code. Notepad++ comes with syntax highlighting and auto-completion, which are the standard features of paid IDEs. But you don’t need to spend a dime to use Notepad++ since it is a free, open source software. You can also use Notepad++ to compare two files.

Before being able to compare two files in Notepad++, you need to install a plugin first since by default, Notepad++ has no feature to compare files. There are a lot of programming help sites along with homework help websites where you can find instructions if you find installing a plugin difficult.

Comparing two files itself is the best way to find the differences between two files. In the context of programming, you can compare two files to find the differences between the old version and the newer versions of your scripts.

How to compare two files in Notepad++

As mentioned, you need to install the plugin first before being able to compare two files in Notepad++. To install the plugin, launch your Notepadd++ and go to Plugins -> Plugins Admin. This will open the Plugins Admin window.

How to compare files using notepad++

On the Available tab, search for the Compare plugin on the available search box and check once it found. Click the Install button to install it. Your Notepadd++ will be restarted automatically once the installation is complete.

How to compare files using notepad++

If you find no Plugins Admin under the Plugins menu, visit this post to fix it.

Start comparing

After installing the Compare plugin, you can start using Notepad++ to compare two files. To get started, open two files (the files you want to compare) in Notepad++ and go to Plugins -> Compare -> Compare (Ctrl+Alt+C). This will show the differences between the two open files, side by side, as shown in the screenshot below.

How to compare files using notepad++

If you want to compare one of the open files with another file, you can set it as the default first file by going to Plugins -> Compare -> Set as First to Compare (Ctrl+Alt+1). You can then open a new file to compare with it.

By default, Notepad++ compares your file in double-view mode (horizontally). You can switch to the vertical mode by right-clicking the gripper and select Rotate to right or Rotate to left.

How to compare files using notepad++

The Compare plugin uses the vary of colors and symbols to show you the changes in your file.

  • Added (+): The line only exists in the new file and not the old ones
  • Remove (-): The line does not exist in the new file and only present in the old file
  • Moved: The line appears once in the other file and a different location.
  • Changed: Most of the line is identical in both files. You’ll see the changes highlighted in orange.

The Compare plugin also comes with a navigation bar which is pretty handy if you are comparing two large files. The way this navigation bar works is pretty similar to a sitemap and bookmark browser. You can activate the navigator bar by going to Plugins -> Compare -> Navigation Bar.

This post will help you how to compare two files in Notepad++. Whether you want to compare two text files to find the differences between them or you need to compare a programming file with two different versions, you will be able to do it within Notepad++.

How to compare files using notepad++

If there is any new line added, a line is deleted or removed, a line is moved, and a line is changed (like some word or letter is added or removed in a line) in any of the two files added for comparison, you can see those changes.

The differences are highlighted with different colors for added lines, deleted lines, changed lines, etc. You can also see a plus icon with green color and a minus icon with red color for a line added or removed in any of those two files.

Compare two files in Notepad++

Notepad++ doesn’t come with a built-in feature to compare two files, but you can use a free Notepad++ plugin called Compare to make it possible. It shows the differences between the two files side by side on the interface of Notepad++.

Here are the steps to compare two files in Notepad++:

  1. Open Notepad++
  2. Access Plugins Admin option
  3. Search Compare plugin in Plugins Admin page
  4. Install the plugin
  5. Open two files in Notepad++
  6. Access Compare plugin options under Plugins menu
  7. Use the comparison options of the Compare plugin.

At first, launch Notepad++ using its desktop shortcut, Windows Search box, or Start menu.

Click on the Plugins menu and then select the Plugins Admin option. Plugins Admin (earlier known as Plugin Manager) page will open.

How to compare files using notepad++

On the Plugins Admin page, search for compare plugin. In the search results, select the Compare plugin, and press the Install button. A confirmation box will open. Press the Yes button in that box.

How to compare files using notepad++

It will close and restart Notepad++ and the Compare plugin will be installed automatically.

Now open two files in Notepad++ that you want to compare. After doing that, click on the Plugins menu and access the Compare plugin. You will see the following options:

  • Set as First to Compare: Using this option, you can make the foreground file the first file (or old file) with which you can compare any other background file (or new file) opened in Notepad++
  • Compare: this option helps to compare the first file with the second file. You have to go to the second file and then use this option for comparison. Any difference such as line added or removed, the line changed, etc., between two files, are highlighted and visible in Notepad++
  • Clear Active Compare
  • Clear All Compares: to close the comparison of all files
  • SVN Diff and Git Diff: to compare the current version of a file with the local Git/SVN database. Helpful for coding files.
  • Ignore Spaces for comparison. For better output, you should uncheck this option
  • Detect Moves option to show/hide icons for added or removed lines
  • Navigation Bar: this option provides a navigation bar on the top right part during the comparison. It is helpful when you are comparing large files. Instead of scrolling manually, you can use a navigation bar to quickly go to a particular part of files that you’re comparing.

How to compare files using notepad++

For each option available for comparison, there is also a hotkey to quickly use a particular option. Use comparison options as per your needs.

Compare Plugin Settings

If you want to adjust color settings for comparison and main settings, then you can access Settings of this Compare plugin and customize them as per your convenience. Use the Settings option available under Compare plugin options. A separate box will open.

Using that box, you can change the default color for an added line, change highlight, moved line, changed line, etc., with any color of your choice. You can also set a highlight transparency level between 0 to 100.

How to compare files using notepad++

Apart from that, the settings box also lets you show/hide the compact navigation bar, set the position of the first file (left or right), wrap-around diffs, automatically go to first difference after full comparison is done, etc.

When Settings are adjusted, press OK to save the changes. That’s all.

This way you can compare two text files, programming files, etc., in Notepad++. Hope this post is helpful.