Text Diff Checker
Compare two texts line by line and list the lines that were added, removed or kept.
Text diff
Paste the original on the left and the new text on the right.
Result
2
Lines added
1
Lines removed
3
Lines kept
Differences (- removed, + added)
apple - banana + blueberry cherry date + elderberry
Private: Everything runs in this page. Nothing you type is sent anywhere or saved.
On this page
Diff examples
| Original | Changed | Result |
|---|---|---|
| a, b, c | a, c, d | a | - b | c | + d |
| x, y | x, y | x | y |
| one, two | one, 2 | one | - two | + 2 |
| a | a, b | a | + b |
| a, b, c | c | - a | - b | c |
Formula
the kept lines are the longest common subsequence of the two lists of lines
How the text diff works
- Step onePaste the original text in the first box and the changed text in the second.
- Step twoChoose whether to ignore spaces at the line ends and upper and lower case.
- Step threeRead the list: a line with - was removed, a line with + was added, and an unmarked line is the same in both.
What this tool does not do
- It compares whole lines only, not words or characters inside a line.
- It cannot detect moved blocks: a moved line shows as one removed and one added line.
- It does not read files; paste the text.
Frequently asked questions
How does it decide what changed?
It finds the largest set of lines that appear in both texts in the same order (the longest common subsequence). Everything else is shown as removed or added.
Does it compare words or characters?
No, only whole lines. A line with one changed letter shows as one removed line and one added line.
Is there a size limit?
About 4 million line pairs, for example two texts of 2,000 lines each. Longer texts are refused with a message.
References
- Hunt, J. W. and McIlroy, M. D. (1976). An Algorithm for Differential File Comparison. Bell Laboratories Computing Science Technical Report 41.