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
- Line endings are never a difference. CRLF, LF, CR and the Unicode separators U+2028, U+2029 and U+0085 all end a line, and a single break at the very end of a text does not add an empty line.
- Ignore case lower-cases both sides before matching, using the Language rule. It is lower-casing, not full case folding: "ß" stays different from "SS".
- Ignore whitespace removes spaces at the start and end of each line, treats every run of whitespace (spaces, tabs, non-breaking spaces, zero-width characters) as a single space, and then compares. "a b" equals "a b", but "a b" is still different from "ab". The spaces are not removed from the display.
- Unicode forms are compared exactly, with no normalisation.
When an option makes two lines equal, the result shows the line from the original text.
Examples
| Original | Changed | Settings | Result |
|---|---|---|---|
| a b c | a B c | Lines | b removed, B added; a and c unchanged (1 added, 1 removed, 2 unchanged) |
| a b | a b c | Lines | c added, 2 unchanged |
| a b | b a | Lines | 1 unchanged, 1 removed, 1 added; which line stays is a tie |
| total: 10 items | total: 12 items | Lines | one line removed, one added; inside them only 10 and 12 are marked |
| one two three | one four five six three | Words | 1 removed (two), 3 added, 2 unchanged |
| a, b, c with Windows (CRLF) breaks | a, b, c with Unix (LF) breaks | Lines | identical |
| Hello | hello | Ignore case: Yes, English | identical, shown as Hello |
| I | ı (dotless) | Ignore case: Yes, Turkish | identical; with the English rule they differ |
| İ (dotted capital) | i | Ignore case: Yes, Turkish | identical; with the English rule they differ |
| I | i | Ignore case: Yes, Turkish | different; with the English rule identical |
| a + 3 spaces + b | a + 1 space + b | Ignore whitespace: Yes | identical (different when No) |
| a + space + b | ab | Ignore whitespace: Yes | different |
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
- Differences you cannot see. A trailing space, a non-breaking space or a zero-width character makes two lines different unless Ignore whitespace is on, which treats spaces, tabs, non-breaking spaces and zero-width characters as whitespace. What stays visible as a difference are different Unicode forms and different letters: a precomposed "ş" (one character) and "s" followed by a combining cedilla (two) look the same and are reported as different, because no Unicode normalisation is applied. That case you have to fix in the source, or normalise the text first, for example with the option in Remove Duplicate Lines.
- Moved text is not recognised. A paragraph moved from the top to the bottom counts once as removed and once as added.
- A replaced line is not a small change. If you rewrite many lines, the pairing of removed and added lines is by position inside the block, so highlights inside lines are only meaningful where the two lines really correspond.
- Limits. Each text may be up to 500,000 characters and 50,000 lines, and in Words mode up to 200,000 tokens (words, spaces and punctuation each count). Beyond that you get a "too long" message. Separately, the comparison stops with "differ too much" above 4,000 added plus removed lines (or tokens) after the matching beginning and end are skipped; two completely different 5,000-line texts hit this. Compare in parts. Comparing a text with an empty one never hits this limit.
- Long results. In Lines mode the page shows the first 2,000 rows of the result; the copied text always contains all of it. Highlighting inside replaced lines is done for the first 500 replaced line pairs; later pairs are shown as whole removed and added lines.
- Colour is not the only signal. Added and removed lines carry a plus or minus and a hidden "Added:" or "Removed:" label for screen readers. Changed words, in Words mode and inside replaced lines, are underlined or struck through and also carry the same hidden label in front of them, so the result can be read without telling red from green.
- It is a viewer, not a judge. There is no merge, no three-way comparison and no similarity verdict. A low number of unchanged lines does not mean copying, and a reworded text will show as entirely different.
- Privacy. Both texts are compared in your browser; nothing is uploaded or stored.
Frequently asked questions
Last updated: 10/11/2026
Related tools
Remove duplicate lines from a list, keep the first or last occurrence, and ignore letter case, surrounding spaces and invisible characters if you need to.
Sort a list alphabetically, naturally (item 2 before item 10) or by line length, ascending or descending, with the right letter order for Turkish.
Remove line breaks from text copied from a PDF, an e-mail or a terminal, keep paragraphs if you want, and rejoin words split by a hyphen at the end of a line.