How to Compare Two Texts and See What Changed
Compare two versions of a document, email, or config file line by line and see exactly what was added or removed — the algorithm behind it, explained simply.
By QR Ivify Team
Two drafts of an email, two versions of a contract, a config file before and after someone else edited it — eyeballing two blocks of text to spot what changed is slow and error-prone, especially past a few dozen lines. A diff tool does this properly, and understanding how it works helps you read the result correctly.
How a Line Diff Actually Works
QR Ivify's Text Diff Checker uses the same underlying approach behind tools like diff and simple git comparisons: it finds the longest sequence of lines that appear, in order, in both texts (the "longest common subsequence"), then reports everything outside that shared sequence as either removed (only in the original) or added (only in the changed version). This is why an edit to a single line shows up as one removed line and one added line, rather than some more granular "half this line changed" indicator — the comparison operates on whole lines.
Step by Step
- Open the Text Diff Checker.
- Paste the original text on the left and the changed version on the right.
- Differences highlight live as you type — green for added lines, red for removed lines.
- The count of added and removed lines is shown above the comparison.
Reading the Result
Lines that appear in both texts, unchanged, show with no highlight — those are the parts that stayed the same. A line that shows red-then-green in roughly the same position usually means that one line was edited (not literally two separate changes) — the algorithm doesn't know the difference between "this line was edited" and "this exact line was deleted and a different one was added nearby," because from a pure line-comparison standpoint, those are the same thing.
A Worked Example
Original:
apple
banana
cherry
Changed:
apple
banana
date
The diff shows "apple" and "banana" unchanged, "cherry" removed, and "date" added — one line changed, reported as a one-line removal and a one-line addition.
Frequently Asked Questions
Does it compare word-by-word or line-by-line? Line-by-line — a line is shown as changed (removed + added) if anything within it differs, down to a single character.
Does this upload my text anywhere? No. Comparison happens entirely in your browser.
Is there a size limit? No hard limit, but very large inputs (many thousands of lines on both sides) fall back to a simplified diff to keep the browser responsive.
Can I use this to compare code? Yes — plain text is plain text; it works on code, config files, or any other line-based content.
Try It
Need to see exactly what changed between two versions of something? QR Ivify's free Text Diff Checker highlights additions and removals line by line. Looking for duplicate lines instead of differences? Try Remove Duplicate Lines.
Related articles
How to Change Text Case Online — UPPERCASE, Title Case & More
Convert text between UPPERCASE, lowercase, Title Case, Sentence case, and more, without losing line breaks — and what actually separates Title Case from Capitalize Each Word.
How to Clean Up Messy Text (Extra Spaces, Blank Lines, Tabs)
Fix text that came through with irregular spacing, blank lines, or tabs — from pasting out of a PDF, a webpage, or a spreadsheet — with cleanup options you control individually.
How to Convert Text to Speech Online (Free, No Signup)
Have text read aloud using your browser's own built-in voices — useful for proofreading by ear, no account or app required.