Whether you’re a computer programmer or an average computer user, you’ve probably needed to compare two files at some point. The best course of action is not to manually skim through the files to identify the differences. Doing so will only waste time that could be better spent elsewhere. Or even worse, you could run the risk of missing out on any significant differences that might occur between the two files.
But worry not. This article delves into the specifics of comparing two files using your preferred text editor, Notepad++. We will show how you can compare two files with and without a plugin, as well as how to diff two files in case you’re working with a version control system. Let’s dive right in.
How to Compare Two Files With Notepad++
There are many reasons why you would want to compare two different versions of a file. For example, if you’re copying a file from one folder to another, packet loss and data corruption might happen along the way. To ensure that your file is indeed similar to its original version, you must perform some comparison.
Notepad++ is a good tool for comparing files. Unfortunately, the functionality isn’t built into the software. For that reason, you’ll need to install the Compare plugin for the process to yield any meaningful results. As the name reads, the Compare plugin allows you to compare two files by highlighting any visual differences that occur between them. The differences are highlighted through the use of different colors and icons. For example, red means a line was omitted, green means a line was added, and orange means the line was modified.
Using the plugin, you can compare various iterations of the files stored on your local machine. To set the bar even higher, the plugin allows you to compare files that are stored on online repositories, namely Git and SVN. Whatever your needs, the Notepad++ Compare plugin has you covered.
How to Compare Two Files in Notepad++ Side by Side
To compare two files in Notepad ++ side by side, follow these steps.
- On your computer, open the Notepad++ app.
- Go to “Plugins” and select “Plugins Admin.” If you miss out on the “Plugins Admin…” option, navigate to “?” then select “About Notepad++” and double-check that you’re running the current version.
- On the “Plugins Admin” modal, search for the plugin called “Compare” and select it from the results.
- In the top-right corner of the screen, press the “Install” button.
- Follow the instructions given in the installation wizard to finish the plugin setup.
- Drag and drop the two files you’d like to compare into your Notepad++ editor and ensure they lie next to each other.
- On the top menu, navigate to “Plugins” and expand the “Compare” menu.
- From the options, select “Compare.” Alternatively, you can press “Ctrl + Alt + C.”
- Instead of manually scrolling through the file to identify the highlighted differences, use the “Compare Navigation” icon instead, especially for large files.
If you have a penchant for personalization and like to tweak things a bit, you’re in luck. The Compare plugin allows you to adjust the settings, giving you a customized experience from the app. Here’s how to customize your Compare plugin settings.
- Go to “Plugins” and open the “Compare” menu.
- From the options, select “Settings.”
- Choose all the custom presets for your files and press the “Reset” button.
Once you’re done comparing your files, go to “Compare” and select the “Clear All Compares” option. This should return your files to normal and remove all the highlights.
How To Diff Two Files With Notepad++
If you’re a developer and want to diff two files using Notepad++, you’ll need to have the Compare plugin installed. The plugin allows you to diff two files that are stored on a local repository. Currently, the Compare plugin supports only two versioning systems, Git and SVN.
Here’s how to diff Git files using Notepad ++.
- Launch Notepad ++.
- Open the Git repository that holds your code.
- Go to “Plugins” and expand the “Compare” menu.
- From the options, select “Git Diff.”
With the Git Diff option selected, you should see the differences between the current file and the file you have stored on the Git repository.
How to diff two SVN files using Notepad ++.
- Open Notepad++.
- Open the SVN repository file that you want to diff.
- Go to “Plugins” and expand the “Compare” menu.
- From the options, select “SVN Diff.”
How to Compare Two Files in Notepad++ Without a Plugin
Don’t want to go through the process of installing a third-party plugin? Well, here’s how to compare two files in Notepad ++ without a plugin.
- Open Notepad++.
- Drag and drop the two files you would like to compare into the editor.
- With the two files open, right-click on the file tab and select “Move to Other View.”
- Your files should now lie next to each other, and you should be able to compare them.
The downside of the above method is that it’s hard to compare two large files. If you skim the files manually, you’re bound to miss out on some critical details.
FAQ
Are Git and SVN the same thing?
Git and SVN are both version control systems, but they aren’t the same platform (think Facebook and Instagram; they are both social networks, but aren’t exactly the same platform). While Git is decentralized, SVN is pretty much a centralized versioning system.
Ditch the Old Way of Skimming Through Files
Files are an essential part of our workflows, and knowing the difference between two file versions doesn’t have to be a hassle. Notepad++ features the Compare plugin, making the process much easier. The plugin has the Git Diff and SVN Diff, which makes it a snap for programmers to diff files stored in repositories and online databases. Regardless of your needs, we hope you can now compare files through the Notepad++ text editor.
Have you tried using a command or a code script to compare two files with Notepad++? Please let us know in the comments section below.
Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.