Skip to content

Text compare for Mac

The quickest way to compare text on a Mac is in your browser: paste the two versions into a compare tool and the differences are highlighted. For Word documents, use Review > Compare in Word for Mac. For files and code, use VS Code's compare view or diff in Terminal.

Text diffUpdated 3 min read

1. In your browser (any text)

Paste the original into the first box below and the changed version into the second. Added lines are marked with a plus, removed lines with a minus, and the words that changed inside a line are highlighted. You can also click Open a file to load a plain-text file from your Mac.

This page opens with ignore extra spaces turned on, so re-indented lines don't show up as changes. Switch to word-by-word mode if the text came from a PDF or an email and the lines wrap in different places. Nothing is uploaded: the comparison runs in Safari or whichever browser you use.

2. Word for Mac (documents)

Word compares two versions of a document and shows the differences as tracked changes in a new document. The original stays untouched.

  1. Open one of the two versions in Word.
  2. On the Review tab, choose Compare > Compare Documents.
  3. In Original document, choose the original.
  4. In Revised document, browse to the other version, then click OK.

Word creates a new copy based on the original, with revision marks for every change in the revised version. To merge two people's edits into one document instead, choose Compare > Combine Documents.

Use Word when the formatting matters as well as the words, or when you need to send back a marked-up document.

3. Visual Studio Code (files and code)

VS Code is a free code editor that runs on macOS, and it has a side-by-side compare view.

  • From the Explorer: hold Cmd and click two files in the Explorer, then right-click and choose Compare Selected.
  • From Terminal: if you've installed the code command, run code --diff old.txt new.txt. VS Code opens a diff editor for the two files.

It's the best fit for code, configuration files and anything in a Git project, because it highlights syntax and lets you edit either side.

4. diff in Terminal (no app at all)

macOS includes the diff command. Open Terminal and run:

diff -u old.txt new.txt

The -u option prints a unified diff: lines starting with - were removed, lines starting with + were added, and a few unchanged lines around each change give you context. With no differences, diff prints nothing.

Use it to check quickly whether two files are identical, or to compare files you can't easily open, such as large logs. Type man diff in Terminal to see every option your Mac's version supports.

Which one should you use?

  • Two pieces of text you can copy: the browser tool. Nothing to open or install.
  • Two Word documents, or a document someone edited: Word's Compare Documents.
  • Code or files in a project: VS Code.
  • A quick check that two files are the same: diff in Terminal.

Common problems

Every line shows as changed. The two texts have different line breaks, often because one was copied from a PDF or an email. In the browser tool, switch to word-by-word mode, which ignores line breaks.

Changes in spacing hide the real edits. Turn on ignore extra spaces in the browser tool, or add -w to diff to ignore white space.

Capital letters changed throughout. Turn on ignore case in the browser tool, or add -i to diff.

Sources

Questions

How can I compare text on my Mac?

Paste both versions into a browser-based compare tool, like the one on this page, and the differences are highlighted. For Word documents use Review > Compare in Word for Mac; for code, VS Code's Compare Selected.

What is the best text compare app for Mac?

It depends on what you compare. A browser tool is quickest for pasted text, Word suits documents with formatting, and a code editor like VS Code suits files in a project.

How do I check if two texts are exactly the same?

Paste them into the two boxes on this page. If nothing differs, the summary says No differences. Turn off ignore case and ignore extra spaces for a strict check.