How to Compare Two Text Files (Online, Notepad++, VS Code, Word)

Whether it is two versions of a contract, a configuration file that changed after an update, or two exported lists, knowing how to compare two text files saves you from reading both line by line. A diff tool lines the files up and highlights exactly what was added, removed or changed – usually in seconds. Below are seven free ways to do it, from the quickest online option to the tools already on your computer.

Screenshot of the Diff Checker on Assen Tools
The Diff Checker in use. Open the Diff Checker – free, no sign-up.

Which method should you use?

Situation Best method
Quick check, any device, nothing to install Online diff checker
You already use Notepad++ on Windows Notepad++ Compare plugin
Code or config files VS Code
Word documents with formatting Word's Compare feature
Google Docs Tools → Compare documents
Scripts, servers or very large files fc (Windows) or diff (Mac/Linux)

1. Online diff checker (fastest)

  1. Open the free Diff Checker.
  2. Paste the original text on the left and the new version on the right.
  3. Click Find difference.

Removed lines are shown in red, added lines in green, and inside changed lines the exact words that differ are highlighted. You can switch between side-by-side and unified views and ignore differences in capitals or spacing. The comparison runs in your browser, so confidential documents are not uploaded.

2. Notepad++ (Windows)

Notepad++ does not compare files out of the box, but the free Compare plugin adds it:

  1. Go to Plugins → Plugins Admin, tick Compare and click Install.
  2. Open both files in Notepad++.
  3. Choose Plugins → Compare → Compare (or press Ctrl+Alt+C).

The files appear side by side with changed lines marked. Use the arrows in the toolbar to jump between differences.

3. Visual Studio Code

VS Code has a built-in compare view:

  1. In the Explorer, right-click the first file and choose Select for Compare.
  2. Right-click the second file and choose Compare with Selected.

From a terminal you can also run code --diff old.txt new.txt. VS Code is ideal for code, JSON and configuration files because it keeps syntax highlighting while showing the differences.

4. Microsoft Word

For documents where formatting matters, Word can compare two versions and produce a third document with every change marked as tracked changes:

  1. Open Word and go to Review → Compare → Compare.
  2. Choose the original document and the revised document.
  3. Click OK.

For PDFs, convert both versions with PDF to Word first, or copy the text into the Diff Checker.

5. Google Docs

Google Docs has the same idea: open the newer document, choose Tools → Compare documents, select the older version from your Drive and click Compare. A new document opens with the differences shown as suggestions.

6. Windows command line: fc

Windows includes the fc (file compare) command. Open Command Prompt and run:

fc /n old.txt new.txt

The /n option adds line numbers. Add /c to ignore upper and lower case. In PowerShell you can compare two files line by line with Compare-Object (Get-Content old.txt) (Get-Content new.txt).

7. Mac and Linux: diff

On macOS and Linux, the diff command is built in:

diff -u old.txt new.txt

Lines starting with - were removed and lines starting with + were added. If you use Git, git diff --no-index old.txt new.txt gives coloured output even for files outside a repository.

Getting a cleaner comparison

Diffs are literal, so small formatting differences can create noise:

Frequently asked questions

How do I compare two text files for differences quickly? Paste both into an online diff checker – it highlights every added, removed and changed line in a second, with nothing to install.

Can Notepad++ compare two files? Yes, with the free Compare plugin from Plugins Admin. After installing it, open both files and press Ctrl+Alt+C.

How do I compare two Excel sheets? Copy each column as text into the two boxes of a diff checker. Sort both lists the same way first so matching rows line up.

How do I compare large files? For files of many megabytes, use VS Code, fc or diff, which handle large files better than a browser tab.

Is it safe to compare confidential files online? Use a tool that compares in your browser, like the Diff Checker, so the text is never sent to a server.

Summary

To compare two text files, use an online diff checker for a quick check, Notepad++ or VS Code if you already work in them, Word or Google Docs for formatted documents, and fc or diff from the command line. Each one highlights exactly what changed, so you never have to hunt for differences by eye again. Try the free Diff Checker next time.

Jonathan Nwachukwu, founder of Assen Tools

Written by

Jonathan Nwachukwu · Founder & developer

Jonathan is a freelance web developer and web development teacher who builds Laravel, WordPress and WooCommerce sites for clients. He built AssenTools to put the everyday file, photo and calculation jobs he kept doing for clients and students into one free, private toolbox, and he maintains every tool and guide on the site.