Text Diff Checker
Compare two texts or files and see every difference, down to the word: what was added, removed and edited, side by side or inline. Works with Word documents and PDFs too. Nothing is uploaded.
+0 added−0 removed0 unchanged0% similar
Merge the two versions
Pick which side to keep for each block of changes, then copy or download the result.
Why use a diff checker?
Reading two versions of a contract, an essay, a config file or a block of code side by side, you will miss changes: a number that moved, a sentence that lost a word, a line deleted from the middle. A diff checker finds every one of them in a second and shows exactly where they are. This one compares by line, then by word or character inside edited lines, opens Word and PDF files as well as plain text, and does it all in your browser, so drafts and private documents never leave your device.
How to compare two texts
- Paste the original text in the first box and the changed text in the second, or tap Open file on either side (text, code, .docx or .pdf). You can also drop files onto the boxes.
- Press Compare (or Ctrl+Enter). Added lines are green, removed lines red, and the words that changed are highlighted more strongly.
- Choose Side by side or Inline, switch highlighting between words and characters, and tick the ignore options you need. The result updates instantly.
- Step through the changes with the arrows, then copy or download the diff, export a PDF or Excel report, or Merge the two versions.
How to read the comparison
Here is what the tool shows for the built-in example, an office notice where one line was dropped, one added and two edited (3 added, 3 removed, 2 unchanged, 74% similar):
| 1 | Removed: Our office is open Monday to | |
| 1 | Added: Our office is open Monday to Saturday, 8am to 6pm. | |
| 2 | 2 | Visitors must sign in at the front desk. |
| 3 | Removed: Parking is free for the first | |
| 4 | Removed: Please keep the meeting rooms tidy. | |
| 3 | Added: Parking is free for the first three hours. | |
| 5 | 4 | Contact reception for lost property. |
| 5 | Added: Bicycles can be left in the courtyard. |
- Red lines exist only in the original and green lines only in the changed text. The two columns of numbers are each line's position in the original and in the changed version.
- Darker highlights mark the exact words that changed inside an edited line: "Friday, 9am to 5pm" became "Saturday, 8am to 6pm" while the rest of the sentence stayed. Switch to Characters to see single letters and digits instead of whole words.
- Side by side lines each edited line up with its replacement; Inline shows the removed line directly above the added one, which suits a phone screen.
- Only show changes folds long runs of identical lines, keeping three lines of context around each change; tap a fold to open it. The arrow buttons jump from one change to the next.
- Similarity is the share of characters the two texts have in common (2 × matching characters ÷ all characters), so a few edits in a long document still read as 98–99% similar.
Ignore whitespace, case and blank lines
Not every difference matters. These options change what counts as "the same line" without editing your text:
- Ignore whitespace: spaces and tabs at the start and end of each line are skipped, and any run of spaces or tabs inside a line counts as one space. Code that was re-indented, or text with double spaces after full stops, then compares as unchanged. It works like
diff -bcombined with ignoring leading spaces. - Ignore case: "Total" and "TOTAL" match, which helps with headings, SQL keywords and anything retyped in a different case.
- Ignore blank lines: a change made only of empty lines, such as an extra blank line between paragraphs, is hidden and not counted, like
diff -B.
Line endings never count: text from Windows (CRLF), macOS and Linux (LF) compares equal, and so does a file that ends with a line break against the same text pasted without one. Merge and the .diff download always compare exactly, because a merged file or patch has to reproduce every character.
Compare Word documents and PDF files
Open a .docx or .pdf on either side and its text is pulled out in your browser and compared like anything you paste. Word paragraphs become lines; in a PDF, lines that belong to one paragraph are joined and running headers, footers and page numbers are left out, so a document that reflowed between versions still lines up. Only the words are compared, not fonts, colours, images or layout.
- Scanned PDFs are pictures of pages with no text layer. Convert them with Image to Text (OCR) first, or extract a text PDF's contents yourself with PDF to Text.
- Password-protected PDFs have to be unlocked first with the PDF password remover.
- Old .doc files (Word 97–2003) can't be read in a browser: open them in Word, LibreOffice or Google Docs and save as .docx.
How a diff checker finds differences
Comparing two texts means finding the longest sequence of lines they share, in order, and calling everything else removed or added. That is the longest common subsequence problem, and the classic fast method is Eugene Myers' 1986 algorithm, "An O(ND) Difference Algorithm and Its Variations", which GNU diff and Git also use. This tool matches identical lines at the start and end first, aligns the middle exactly when it is small, and for large files first pins down lines that occur exactly once on each side (the idea behind patience diff) before running Myers' algorithm on the gaps. Each removed line is then paired with the added line most likely to be its edit and compared again word by word, which is where the darker highlights come from.
Download .diff saves the result in unified diff format, the same format diff -u and git diff print. For the example, with one line of context:
--- notice-v1.txt +++ notice-v2.txt @@ -1,5 +1,5 @@ -Our office is open Monday to Friday, 9am to 5pm. +Our office is open Monday to Saturday, 8am to 6pm. Visitors must sign in at the front desk. -Parking is free for the first two hours. -Please keep the meeting rooms tidy. +Parking is free for the first three hours. Contact reception for lost property. +Bicycles can be left in the courtyard.
Lines starting with - were removed, + added, and a space marks unchanged context. A header such as @@ -3,2 +3,1 @@ reads: two lines starting at line 3 of the original became one line starting at line 3 of the new version. The patch command can apply the file to the original.
Compare files on the command line and in other apps
- macOS and Linux:
diff -u old.txt new.txt, orgit diff --no-index old.txt new.txtfor coloured, word-level output with--word-diff. - Windows:
fc old.txt new.txtin Command Prompt, orCompare-Object (Get-Content old.txt) (Get-Content new.txt)in PowerShell. - VS Code: select both files in the Explorer and choose Compare Selected, or run
code --diff old.txt new.txt. - Microsoft Word: Review › Compare › Compare Documents produces a redlined copy with tracked changes.
This page needs none of them and works the same on a phone.
Tips for cleaner comparisons
- Text copied from a PDF or an email is often hard-wrapped, so every line differs. Join the lines first with Remove Line Breaks, then compare paragraphs.
- Comparing two lists where the order doesn't matter? Sort both with the text sorter (and remove duplicate lines) before comparing, so only real additions and removals show.
- Minified or single-line JSON compares badly. Format both sides with the JSON formatter so each value sits on its own line.
- To see what an automatic clean-up changed in a Markdown file, the Markdown cleaner has this comparison built in. To check the length of either version, use the word counter.
Frequently asked questions
How do I compare two texts for differences?
Paste the original text in the first box and the changed version in the second, or open a file on either side, then press Compare. Added lines turn green, removed lines red, and the exact words that changed inside an edited line get a darker highlight. After the first comparison the result updates as you edit either box.
Is it safe to paste confidential text into this diff checker?
Yes. The comparison runs in your browser with JavaScript: the texts and any files you open are never uploaded or stored on a server, and once the page has loaded, comparing pasted text keeps working with your internet connection switched off. Only your display settings (view, highlighting and ignore options) are remembered on this device; your text is not saved.
Can I compare two Word documents or PDF files?
Yes. Open a .docx or .pdf file on each side and its text is extracted in your browser (Word files with the open-source mammoth library, PDFs with Mozilla's pdf.js), then compared like pasted text. Only the words are compared, not fonts, images or layout. A scanned PDF has no text to extract, so run it through an OCR tool first, and save old .doc files as .docx.
What is the difference between side-by-side and inline view?
Side by side shows the original on the left and the changed text on the right, with unchanged lines aligned across, which is how most review tools present a comparison. Inline (unified) view uses one column: removed lines (−) appear directly above the lines that replaced them (+), the format git diff uses. Inline view is easier to read on a phone, so narrow screens start with it.
What do the darker highlights inside a line mean?
When a line was edited rather than added or deleted, it is paired with its new version and compared again, word by word or character by character. The light tint marks the whole line and the darker highlight marks exactly what was removed or inserted. Words reads best for prose; Characters catches a single changed letter, digit or punctuation mark.
What do Ignore whitespace, Ignore case and Ignore blank lines do?
Ignore whitespace skips spaces and tabs at the start and end of each line and treats any run of spaces or tabs inside a line as one space, so re-indented code or double spaces don't count as changes. Ignore case treats capital and small letters as the same. Ignore blank lines hides changes made only of empty lines, like diff -B. Merging and the .diff download always compare exactly.
How is the similarity percentage calculated?
It is 2 × the characters the two texts have in common ÷ the total characters in both, the same ratio Python's difflib reports. Unchanged lines count in full and edited lines count their unchanged words or characters, so the figure can differ slightly between Words and Characters. 100% means no differences, after any ignore options.
Why does a line show as changed when it looks the same?
The difference is usually invisible: a trailing space, a tab instead of spaces, a non-breaking space, curly instead of straight quotes, or a zero-width character. Switch the highlighting to Characters to see which character differs, or tick Ignore whitespace for spacing differences. Windows (CRLF) and Unix (LF) line endings already count as the same.
What is a .diff or .patch file?
A unified diff is the standard text format for a set of changes, written by diff -u and git diff. Lines starting with - were removed, lines starting with + were added, and a leading space marks unchanged context. Each block starts with a header such as @@ -12,7 +12,8 @@: seven lines from line 12 of the original became eight lines from line 12 of the new version. Download .diff writes one with three lines of context.
How do I compare two files in Notepad++, VS Code or Word?
In Notepad++, install the Compare plugin from Plugins Admin, open both files and choose Plugins › Compare › Compare. In VS Code, select both files in the Explorer and choose Compare Selected, or run code --diff old.txt new.txt. In Word, use Review › Compare › Compare Documents. On the command line: diff -u old.txt new.txt on macOS and Linux, or fc old.txt new.txt in Windows Command Prompt.
How large can the texts be?
Files up to 25 MB can be opened, and tens of thousands of lines usually compare in about a second when most lines are shared, which is the normal case for two versions of a document. If two very large texts are almost entirely different, part of the result may be shown as removed and re-added in full; the page says so when that happens. Only show changes keeps long results short.
Can I merge the two versions into one?
Yes. After comparing, press Merge: every block of changes gets Original, Changed and Both buttons, unchanged lines are kept, and the merged text can be copied or downloaded as a .txt file.
Related tools
More free, private, browser-based utilities — no upload, no sign-up.