Text Diff Checker
Compare two texts line by line and see exactly which lines were added, removed or left unchanged, with a full diff table.
Loading calculator…
What this tool does
Compare two texts line by line and see exactly which lines were added, removed or left unchanged, with a full diff table. Comparison is line-based and exact: a line with one changed word counts as one removal plus one addition, and leading/trailing spaces make lines different. There is no word-level highlighting inside a changed line.
How to use the Text Diff Checker
- Enter or select original text.
- Enter or select revised text.
- Read the calculated result; change any measurement to compare alternatives.
Formula
A longest-common-subsequence (LCS) dynamic program over lines finds the largest set of lines the two texts share in order; original lines outside the LCS are removals (−) and revised lines outside it are additions (+), shown in the result table in document order.
- original
- Original text
- revised
- Revised text
Comparison is line-based and exact: a line with one changed word counts as one removal plus one addition, and leading/trailing spaces make lines different. There is no word-level highlighting inside a changed line.
Worked example
For text diff checker, the following measurements illustrate the exact method: Original text: The quick brown fox jumps over the lazy dog Pack my box with five dozen liquor jugs; Revised text: The quick brown fox leaps over the lazy dog Pack my box with five dozen liquor jugs.
Inputs
- Original textThe quick brown fox jumps over the lazy dog Pack my box with five dozen liquor jugs
- Revised textThe quick brown fox leaps over the lazy dog Pack my box with five dozen liquor jugs
Result
- Changed lines2
- Added lines (+)1
- Removed lines (−)1
- Unchanged lines2
- Line similarity (%)66.67
Results explained
- Changed lines
- Changed lines from the formula above. Comparison is line-based and exact: a line with one changed word counts as one removal plus one addition, and leading/trailing spaces make lines different. There is no word-level highlighting inside a changed line.
- Added lines (+)
- Added lines (+) from the formula above. Comparison is line-based and exact: a line with one changed word counts as one removal plus one addition, and leading/trailing spaces make lines different. There is no word-level highlighting inside a changed line.
- Removed lines (−)
- Removed lines (−) from the formula above. Comparison is line-based and exact: a line with one changed word counts as one removal plus one addition, and leading/trailing spaces make lines different. There is no word-level highlighting inside a changed line.
- Unchanged lines
- Unchanged lines from the formula above. Comparison is line-based and exact: a line with one changed word counts as one removal plus one addition, and leading/trailing spaces make lines different. There is no word-level highlighting inside a changed line.
- Line similarity (%)
- Line similarity (%) from the formula above. Comparison is line-based and exact: a line with one changed word counts as one removal plus one addition, and leading/trailing spaces make lines different. There is no word-level highlighting inside a changed line.
Frequently asked questions
Rows marked + are lines present only in the revised text (additions), rows marked − are lines present only in the original (removals), and rows marked · are unchanged lines shared by both, all shown in document order.
The classic longest-common-subsequence dynamic program over lines — the same family of algorithm behind Unix diff. It finds the maximum number of lines the two versions share in order, which minimises the additions and removals reported.
The comparison unit is the whole line, so any change inside a line — even one word — retires the old line (−) and introduces the new one (+). This matches how code review and document diff tools present line edits.
Unchanged lines divided by the line count of the longer text, as a percentage. Two identical texts score 100%; a text sharing half its lines with a longer revision scores about 50%.
No. Both texts are compared locally in your browser; neither version is uploaded, stored or sent anywhere — safe for drafts and contracts.