How to compare files on Mac

Asya Karapetyan
Content marketer, who specializes in Mac how-to guides
October 11, 2023
7 minutes to read

Do you need to compare two files or folders to see the differences between them? Read this article to learn how to compare two documents for differences on your Mac, how to compare folders for duplicate content, and how to merge folders to organize files in Finder.

Contents:

  1. What can be compared in Mac files?
  2. Compare files and folders on Mac using Terminal
  3. Compare files and folders on Mac – Easy Way

Before we start

macOS doesn’t come with an easy tool to easily compare files. Below, we explain how to compare files using Terminal, but this method is more for tech geeks. However, there are third-party apps you can use to find differences between files – for example, Duplicate File Finder from Nektony.

Duplicate File Finder is a software tool to find duplicates of any file type on your Mac. It can also be used as a file difference checker because it provides features to compare files and detect duplicates, compare folders for duplicate content, and even merge folders. It can compare even audio files and pictures.

“Duplicate

Duplicate File Finder

Free Download

What can be compared in Mac files?

Before we explain how to compare files on Mac and find a difference between them, let’s clarify what it means and see what types of files can be compared.

Comparing files on a Mac means identifying and highlighting the differences between two files. Comparing files is one way to determine whether they’re duplicates. With this in mind, it should be clear that you can only compare a file with another file of the same type. This means, for example, that you can’t compare an image with a text file. However, the file comparison doesn’t have to be based on the files’ content; you can also compare attributes like size, modification date, or permissions.

Comparing files can be particularly useful when you’re trying to find exact differences between two versions of a file or identify where changes were made to a document, code, or configuration file.


How to compare files and folders on Mac using Terminal

If you know how to work with the Terminal (the macOS command line utility), you can use the diff command to compare files and folders on your Mac.

Comparing files on Mac with Terminal:

  1. Open Terminal. You can find the app in the Applications folder or in the Launchpad.
  2. Navigate to the directory that contains the files you want to compare.
  3. Use the following command:

    diff (file input 1) (file input 2)

    For example, if you want to compare two files called Leccion 36.docx and Leccion 37.docx, the command will be the following:

    diff “Leccion 36.docx” “Leccion 37.docx”

Terminal window showing the compare files command

Comparing folders on Mac with Terminal:

  1. Run Terminal.
  2. Use the following command:

    diff -rq folder1 folder2

Where folder1 and folder2 are the two folders you want to compare. Instead of typing the paths to the folders, you can simply drag and drop folders onto the Terminal window.

Terminal window showing the sesults of comparing folders

How to compare two files or folders on Mac using Duplicate File Finder

There are many third-party file compare tools for Mac that can help you compare text files, compare PDF files, compare folders, and compare other items on your Mac. If all you need is to see whether the files or folders are duplicates, you can use Duplicate Files Finder. Besides being a great file comparison tool, Duplicate File Finder provides also a merge tool, that helps you organize your files. It’s a Mac quick and easy tool to compare any files and it’s available to download from the Mac App Store.

Comparing two files on Mac using Duplicate File Finder:

  1. Launch Duplicate File Finder.
  2. Click Compare files in the sidebar.
  3. Drop or browse the two files that you want to compare.
  4. Click the Compare Files button.
  5. The app will display the differences in red and show whether the files are duplicates or not.
Comparing files

Comparing two folders on Mac using Duplicate File Finder:

Duplicate File Finder also allows you to compare two folders and see whether they have the same contents. Here’s how:

  1. Run Duplicate File Finder.
  2. Click Compare folders in the sidebar.
  3. Drop two folders that you want to compare into the app window.
  4. Click Compare Folders.
  5. In the Results window, you’ll see whether the folders contain the same files. Duplicates are marked by the “=” sign.
  6. Select and remove unneeded files, for example, useless duplicates. Comparing folders
  7. Duplicate File Finder can also be used as a Mac file merger. Just click the Merge Folders button in the app.
  8. Choose a folder whose files you want to move, and another folder to move them to. You can also choose to merge two folders into a new folder.
  9. Click Review and Merge and confirm the action. Merging folders

Conclusion

The next time you need to compare files or folders on your Mac, we hope this guide will prove to be helpful. If you have any additions or suggestions that may help our readers out, please post them in the comments section below.


 

Scroll to Top