Last Updated:

Notepad++ makes easier to compare two files 

To find differences in the contents of two files on your PC, you need to compare them. Manually, this process can take a long time, but special programs allow you to perform this operation in a few seconds. For different file formats, certain tools are intended, discussed below.

How to Compare Two Files on a PC Quickly and Easily

Compare two files in Notepad++

 

Notepad++ is a feature-rich application supported by Windows. Running the utility is also possible on Linux. With its help, you can compare the contents of php, html, javascript and other files. Regular text documents also open in Notepad, but Word is better for working with them correctly. The comparison in Notepad is as follows:

  1. You need to install the "Compare" plugin inside the program. To do this, you will need to open the "Plugins" menu on the top panel, select "Plugin Manager" in the drop-down list and click on the "Show Plugin Manager" button.
  2. In the window that opens, find the line with the inscription "Compare", put a tick next to the name of the plugin and click "Install".
  3. When the installation is complete, you can start comparing the objects of interest. To do this, you will need to open two documents in Notepad++ in adjacent tabs, enter the "Plugins" menu, select "Compare" from the list and click on the "Compare (Alt+D)" button.

Notepad will compare the two files and show inconsistencies in adjacent tabs. Different lines will be marked with warning signs (red minuses - deleted fragments, yellow exclamation points - changed parts, green pluses - added elements) and highlighting.

Total Commander gives the user the ability not only to compare documents by content, but also to change the data in them at the same time. The utility runs on Windows, there is no Linux support. To make a comparison:

  1. Select the two documents of interest in the Total Commander application window.
  2. Go to the "File" menu and select the "Compare by Content" option from the list of available commands.
  3. This opens a window divided into two workspaces. Each of them will show the data from the selected documents.
  4. Rows with changed elements are highlighted with a gray highlight. Radically different fragments are highlighted in red font.

For faster and easier navigation, the application provides "Next" and "Previous difference" buttons. To make instant edits, just click "Edit". The Roll Back command undoes recent changes.

Comparison via Microsoft Word

 

With the comparison of text documents and files with extensions such as doc and docx, the Word editor copes best. The user needs to:

  1. Start Microsoft Word (it is not necessary to open the file of interest immediately).
  2. Go to the "Review" tab and click on the "Compare" button.
  3. In the window that opens, select the necessary files: "Source Document" and "Modified Document" (will be compared with the original one).
  4. Set additional parameters as desired and click "OK".

The result of these steps is to open a new file in Word, where the inconsistencies found in the selected documents will be noted.

Comparing Files at the Windows Command Prompt

 

The Windows Command Prompt is a standard tool that allows you to compare files without installing auxiliary programs. The main disadvantage of this method is the inability to edit documents after analysis. However, the tool successfully copes with the search for inconsistencies.

 

To use the command line:

  1. Open the Start menu.
  2. Select All Programs, the Accessories tab, and launch the Command Prompt utility.
  3. Type fc /N first file path (without the quotation marks). For example, fc /N D:\Downloads\project1.txt D:\My Documents\project2.txt

Of all the methods presented, the latter is the least convenient. It can be used for documents with a small amount of data. For larger files, it is better to use Notepad++.