Text compare (diff)
Compare two texts line by line and highlight additions/removals.
You have two copies of the same document — a config file, a contract clause, a draft email — and you are fairly sure something changed, but reading both side by side gets you nowhere. This tool lines the two texts up and marks every difference for you.
Paste the original on the left, the newer version on the right, press Compare, and you get a colour-coded list of added and removed lines plus a count of what stayed the same.
How it works
How the comparison works
Both texts are split on line breaks, and the tool finds the longest common subsequence of lines — the largest set of lines that appear in the same order in both versions. Everything outside that common set is reported as a change:
| Marker | Meaning |
|---|---|
| Added | The line exists in the compare text but not in the original |
| Removed | The line exists in the original but not in the compare text |
| Unchanged | The line appears in both, in the same relative order |
Because the match runs on whole lines, editing a single word inside a line shows up as one removal plus one addition, not as a word-level highlight. That is normal for line diffs and is the same behaviour you see in diff and in most code review tools.
Ignore whitespace and case
Tick Ignore whitespace & case and each line is normalised before matching: runs of spaces and tabs collapse to a single space, leading and trailing spaces are dropped, and everything is lowercased. Use it when re-indented code or inconsistent capitalisation is drowning the real changes. The result panel still shows your original lines — only the matching is relaxed.
Reading the summary
The bar above the result gives three numbers: lines added, lines removed, lines unchanged. A large added count paired with a large removed count usually means the text was reordered or reformatted rather than rewritten.
A note on privacy
The comparison runs in your browser with JavaScript. Nothing you paste is uploaded or stored. Very long texts (many thousands of lines on both sides) can still make the page pause for a moment, since the matching cost grows with the two line counts multiplied together.
Terms explained
- Diff
- A summary of the differences between two versions of a text, expressed as lines added and lines removed.
- LCS (longest common subsequence)
- The matching method used here: the longest run of lines, in order, that both texts share. Whatever falls outside it is treated as a change.
- Line-level comparison
- Matching is done on whole lines rather than individual words, so any edit inside a line appears as a removal plus an addition.
- Normalisation
- Cleaning up text before comparing it — here, collapsing whitespace and lowercasing — so that cosmetic differences do not count as changes.
- Unchanged lines
- Lines present in both texts. A high count means the two versions are mostly identical.
Frequently asked questions
Why is a small word change shown as a whole line removed and added?
The tool matches complete lines, so any edit inside a line makes that line unequal to its counterpart. It is reported as the old line removed and the new line added. Read the two adjacent entries together to see what actually changed within the line.
Is my text sent to a server?
No. The comparison is done by JavaScript running in your browser, so the text never leaves your device. You can even load the page, disconnect from the network, and it will still work.
The two texts look identical but everything is flagged as changed. Why?
This is almost always a line-ending or invisible-whitespace mismatch — for example one file uses Windows CRLF endings and the other uses Unix LF, or one was re-indented with tabs. Turn on Ignore whitespace & case and compare again.
Can it compare two files instead of pasted text?
Not directly; there is no file upload. Open each file in a text editor and paste the contents into the two boxes. For large files, comparing a section at a time is faster.
Is there a limit on how much text I can compare?
There is no hard limit, but the work grows with the size of both texts, so pasting several thousand lines on each side can freeze the page briefly. If it feels slow, compare the relevant section rather than the whole document.
Tell us what went wrong and we'll fix it fast. (Leave an email if you'd like a reply.)