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.
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)
- Open the free Diff Checker.
- Paste the original text on the left and the new version on the right.
- 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:
- Go to Plugins → Plugins Admin, tick Compare and click Install.
- Open both files in Notepad++.
- 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:
- In the Explorer, right-click the first file and choose Select for Compare.
- 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:
- Open Word and go to Review → Compare → Compare.
- Choose the original document and the revised document.
- 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:
- Text copied out of PDFs often has broken lines – clean it with Remove Line Breaks first.
- For lists, sort both files the same way and remove repeats with Remove Duplicate Lines, so only genuine differences remain.
- If capitals do not matter, normalise them with the Case Converter or tick "ignore case".
- For JSON, format both versions with the JSON Formatter so the keys line up – see how to format JSON.
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.