Two folders side by side in Windows

Comparing two folders without actually going through their contents can be handy at times. Let’s look at some methods to accomplish this in Windows.

Of course, you can always manually open every directory to check the files, but that gets unwieldy — especially if you are sifting through dozens or even hundreds of folders with similar files (backups, for example). For such scenarios, you need a better approach.

Table of Contents

    Using the Properties Window

    A simple way to get a quick glance at the details of any folder is by looking at the Properties. While this saves you from having to open the folder and peruse the contents, you still have to individually right-click every directory you want to check the properties of.

    This makes it unsuitable for large-scale comparisons, but for most home users, that is not an issue. If all you want is to look at the size of each folder and how many files it contains, the Properties window is enough.

    1. To open the Properties window of a folder, right-click on it and select Properties from the menu.
    How to Compare Two Folders or Directories in Windows image 2
    1. This opens a small window displaying all details of the folder, including its size, the number of other files or folders contained in it, as well as the time and date of creation.
    How to Compare Two Folders or Directories in Windows image 3
    1. To compare with another folder, simply drag this window to a side and repeat the process with the second directory.
    How to Compare Two Folders or Directories in Windows image 4
    1. This way, you will have the two properties windows open side by side to compare directly. If your screen size permits, you can extend this even further and keep opening the Properties of other folders as well.

    With WinMerge

    There are other ways besides the Properties window to compare files and folders in Windows, but we are jumping straight to a third-party tool first. Why? Because it is much easier.

    Let’s face it – no one fancies having to use the Command Prompt or type a PowerShell script for any task. While these methods have their uses (especially in system administration), most end users will find it easier to use a dedicated file comparison tool.

    And that’s where WinMerge comes in. There are a bunch of such applications, of course, but WinMerge is by far the most popular. It is a free tool, so it costs you nothing to download and use if you find yourself comparing folders.

    Don’t be confused by its name – while its primary use is to merge folders, it can

    1. To start comparing folders using WinMerge, download the software from its official website. Multiple installers are available, though going with the top one is usually the best option.
    How to Compare Two Folders or Directories in Windows image 5
    1. Run the downloaded setup to install WinMerge on your computer.
    How to Compare Two Folders or Directories in Windows image 6
    1. Launching WinMerge opens a blank window as no folders have been selected yet.
    How to Compare Two Folders or Directories in Windows image 7
    1. Open a folder by selecting File > Open or clicking on the dedicated icon on the toolbar. You can also hit the Ctrl + O on your keyboard.
    How to Compare Two Folders or Directories in Windows image 8
    1. Up to three folders can be opened simultaneously, allowing you to compare them. Click on the Browse button under each of the entries to select the folders to be compared. At least two are needed for comparison – the third is optional.
    How to Compare Two Folders or Directories in Windows image 9
    1. One problem you may run into when using this method is that the window keeps opening the folders you want to select. To get past this issue, right-click on the target folder and select the Copy as path option,pasting this into the text bar.
    How to Compare Two Folders or Directories in Windows image 10
    1. Hit enter when you are done. WinMerge will now go through the folders you specified, comparing their files and collecting all relevant information.
    How to Compare Two Folders or Directories in Windows image 11
    1. When this scan is complete, the files will be listed in an easy-to-parse format. Unique files are categorized as “Left” or “Right” depending on which folder they belong to. Identical files are highlighted in red with both the dates of creation listed at once.
    How to Compare Two Folders or Directories in Windows image 12

    Through the Command Prompt

    Third-party tools aside, Windows has some utilities for file comparison as well. Unfortunately, they lack a GUI, since we are talking about CMD commands. But if the terminal screen does not daunt you, the robocopy command (and yes, that’s the actual name of the command) can be a powerful tool.

    While the Properties window is good for comparing folders at a glance, it doesn’t really tell you much about their contents or how they differ. Which is a problem when you are comparing backup folders, as you need to quickly find out the unique files in them. The robocopy command is perfect for this.

    1. To compare folders using the terminal, open Command Prompt. Just type cmd in the Start menu and open the app.
    How to Compare Two Folders or Directories in Windows image 13
    1. Now we can use the robocopy command to compare directories. Keep in mind that by default, the command is meant for copying files, so you need to add some flags for it to compare them instead.
    2. Begin by typing robocopy followed by the paths of the two folders you want to compare (you can right-click on the folders and select Copy as path to get their paths easily). Like this:
      robocopy “C:\Users\lloyd\Documents” “C:\Users\lloyd\Downloads”
    How to Compare Two Folders or Directories in Windows image 14
    1. Next, we will append the following flags in the command
      /L /NJH /NJS /NP /NS
      The final command will look like this:
      robocopy “C:\Users\lloyd\Documents” “C:\Users\lloyd\Downloads” /L /NJH /NJS /NP /NS
    How to Compare Two Folders or Directories in Windows image 15
    1. Once everything is in place, hit the enter key. The contents of the directories will be compared, giving you a summary of their differences. Unique files in the first folder are listed under New File while differing files in the second folder come under Extra File. When files are the same, they get sorted into Older or Newer based on their creation date in the first directory.
    How to Compare Two Folders or Directories in Windows image 16

    Using Powershell

    Command Prompt isn’t the only command-based interface in Windows. Powershell is a more modern, more powerful scripting feature that can be used to automate most Windows tasks, and of course, compare folders.

    Unlike Command Prompt, however, Powershell doesn’t quite have a dedicated command to compare folders. Instead, we need to chain together multiple commands to get the differences between two directories.

    To pull it off, we will first recursively use the Get-ChildItem command on both the directories and store them in different variables. Then we can use the Compare-Object command to compare the data and list out the differences..

    If this seems more involved than the Command Prompt, it is. The main advantage of Powershell is that it can be scaled up to hundreds or even thousands of folders easily.

    1. To start comparing folders with the powerful scripting utility, search for Powershell in the Start Menu and run it. This usually opens the PowerShell Integrated Scripting Environment, or PowerShell ISE as it is named in the menu.
    How to Compare Two Folders or Directories in Windows image 17
    1. The PowerShell window will open with a blank script, starting at your user directory just like the Command Prompt.
    How to Compare Two Folders or Directories in Windows image 18
    1. Use the Get-ChildItem command recursively on the first folder’s path and store the result in a variable. Like this:
      $folder1 = Get-ChildItem -Recurse -Path “C:\Users\lloyd\Documents”
    How to Compare Two Folders or Directories in Windows image 19
    1. Repeat this for the second folder, using a different variable.
      $folder2 = Get-ChildItem -Recurse -Path “C:\Users\lloyd\Downloads”
    How to Compare Two Folders or Directories in Windows image 20
    1. Now, use the Compare-Object command on the two variables, giving you the differences in their contents.
      Compare-Object -ReferenceObject $folder1 -DifferenceObject $folder2
    How to Compare Two Folders or Directories in Windows image 21

    What is the Best Method to Compare Two Folders in Windows?

    Built-in methods of comparing directories are scarce in Windows, so the most convenient option is to use a third-party tool like WinMerge. Such a method is user-friendly and flexible, giving you the best experience in comparing multiple folders without getting overwhelming.

    If you are only interested in a surface-level comparison, simply opening the Properties window of the folders side-by-side may be good enough. This is handy for determining the size of folders, or the number of files they contain.

    But the most powerful method of comparing directories is invariably by using scripts or commands. For this, you can either leverage Powershell or the Command Prompt. The syntax is a bit weird in both cases, but you can always copy the command for subsequent uses, and copy the paths from the Properties tab too.

    Leave a Reply