GlobalKit

Text Compare

Compare two texts and see which lines or words were added, removed or left unchanged, with options to ignore case and spacing.

Up to 500,000 characters per text. Nothing leaves your device.

Up to 500,000 characters per text. Nothing leaves your device.

Lines marks whole lines, with changed words highlighted inside replaced lines. Words compares word by word.

Treat uppercase and lowercase letters as equal.

Ignore leading and trailing spaces and treat runs of spaces and tabs as one space.

How it works

Paste the original in the first field and the changed text in the second; the result updates as you type. The question being answered is: what is the smallest set of edits that turns the first text into the second? The edits are only deletions and insertions. A line you edited therefore appears as the old line removed and the new line added. There is no separate "modified" category.

Finding that set is the same problem as finding the longest common subsequence: the longest run of lines (or words) that occur in both texts in the same order. Everything in that run is unchanged, the rest of the original is removed, the rest of the changed text is added. The tool uses Myers's 1986 O(ND) algorithm, which is quick when the texts are similar and slows down as they drift apart.

The shortest script is not the only one. If two lines are swapped, "a, b" becomes "b, a", then either line can be the one that stays and the other is reported as removed and added; both scripts are equally short. The tool follows one fixed rule (inside a replaced block, removals are listed before insertions), so the same input always gives the same result, but another comparison tool may keep the other line.

Lines and words

Lines treats each line as one unit and shows whole lines with a plus or minus. Inside a block of changed lines, the first removed line is paired with the first added line, the second with the second, and so on, and the words that differ inside each pair are struck through or underlined. Extra lines in a block that has more removals than additions are shown whole. In-line highlighting is skipped for a pair when a line is longer than 5,000 characters or the pair needs more than 1,000 word-level edits; the lines are then simply shown without it.

Words cuts both texts into words, spaces and punctuation and shows the result as running text with removed words struck through and added words underlined. Use it for prose where line breaks are arbitrary. The counters then count words only; spaces and punctuation are not counted. This has one visible consequence: "a b" (two spaces) against "a b" is shown as a change, because the space run differs, yet the counters stay at 0 added and 0 removed. In Lines mode the same pair is one removed and one added line. With Ignore whitespace on, neither mode reports it. In both modes one line break at the very end of a text is ignored, so "a" and "a" followed by a break are identical; two breaks against one are a difference.

What counts as the same

When an option makes two lines equal, the result shows the line from the original text.

Examples

OriginalChangedSettingsResult
a
b
c
a
B
c
Linesb removed, B added; a and c unchanged (1 added, 1 removed, 2 unchanged)
a
b
a
b
c
Linesc added, 2 unchanged
a
b
b
a
Lines1 unchanged, 1 removed, 1 added; which line stays is a tie
total: 10 itemstotal: 12 itemsLinesone line removed, one added; inside them only 10 and 12 are marked
one two threeone four five six threeWords1 removed (two), 3 added, 2 unchanged
a, b, c with Windows (CRLF) breaksa, b, c with Unix (LF) breaksLinesidentical
HellohelloIgnore case: Yes, Englishidentical, shown as Hello
Iı (dotless)Ignore case: Yes, Turkishidentical; with the English rule they differ
İ (dotted capital)iIgnore case: Yes, Turkishidentical; with the English rule they differ
IiIgnore case: Yes, Turkishdifferent; with the English rule identical
a + 3 spaces + ba + 1 space + bIgnore whitespace: Yesidentical (different when No)
a + space + babIgnore whitespace: Yesdifferent

The copied text

Copy gives the whole comparison, unchanged lines included. In Lines mode each line starts with "+ ", "- " or two spaces:

  a
- b
+ c

That is the comparison of "a, b" with "a, c". In Words mode removed runs are written as [-removed-] and added runs as {+added+}, with unchanged text as it is, so "one two" against "one three" copies as one [-two-]{+three+} and the 1-for-3 example above as one [-two-]{+four five six+} three. The plus and minus convention is the same one used by the unified diff format; the word markers are a plain-text way to carry the same information inside a sentence.

Things to watch for

Frequently asked questions

Last updated: 10/11/2026

Related tools