How to compare two files on macOS?

MacOS Tahoe (26.7). A simple question: is there, on MacOS, a utility that allows to tell if there are differences between the contents of two files?


[Re-Titled by Moderator]

Original Title: Differences between two files?

MacBook Pro 16″, macOS 26.7

Posted on Sep 17, 2026 9:47 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 17, 2026 10:53 AM

to add— you can keep it simple:


Terminal commands to compare folders  / and compare file content:

you can drag and drop the files directly onto the Terminal window for the complete path to your folder/files


ex.

diff -rq folder1 folder2


 The -r is recursive and the -q is brief. So it will provide a list of filenames which are different.

diff -r --brief --exclude=.git /path/to/folder1 /path/to/folder2


ex.

files can be compared:

diff (file input 1) (file input 2)



All differences are listed in the output...

if you are returned to the prompt with no difference list...they are exactly the same.


(a little more cumbersome to use the -y flag for side by side comparison)

14 replies
Question marked as Top-ranking reply

Sep 17, 2026 10:53 AM in response to DenisMaillard

to add— you can keep it simple:


Terminal commands to compare folders  / and compare file content:

you can drag and drop the files directly onto the Terminal window for the complete path to your folder/files


ex.

diff -rq folder1 folder2


 The -r is recursive and the -q is brief. So it will provide a list of filenames which are different.

diff -r --brief --exclude=.git /path/to/folder1 /path/to/folder2


ex.

files can be compared:

diff (file input 1) (file input 2)



All differences are listed in the output...

if you are returned to the prompt with no difference list...they are exactly the same.


(a little more cumbersome to use the -y flag for side by side comparison)

Sep 17, 2026 9:57 AM in response to DenisMaillard

I have used VisualDiffer for many years and it's my preferred file/folder comparison tool.


It used to be a paid app via the AppStore but for reasons I'm not privy to the developer removed it and it became an opensource project. You can find on on GitHub. (Note, I have not used the opensource version myself, so I am not able to compare it to the older, paid version.)

Sep 26, 2026 6:08 AM in response to davide.osx

FWIW, the paid version I have (Visual Differ 1.8.10) works perfectly fine on Monterey. I've had no problems with it.


In my earlier post I meant that I'd try the opensource version once I move to Sequoia. Your wiki page says "MacOS 13+" ... which I would interpret to mean that it would work on Ventura, Sonoma, Sequoia, etc. Is that not the case?

Sep 26, 2026 5:51 AM in response to davide.osx

davide.osx wrote:
Hi, here the VisualDiffer author. The open version is the successor to the one that used to be on the store; over the years, dozens of bugs have been fixed and features added. This means the open version is superior in every respect and, above all, I actively maintain it, with the latest release coming out just today.

That is good to know. I'm still using the paid version on Monterey but would like to move to Sequoia. I'll give it a try. Thanks for the info.

How to compare two files on macOS?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.