Unicode & Text Authority
TEXT REFERENCE / TOOLS

Text comparison tool

Compare two texts line by line and identify additions and deletions.

Compare up to 500 lines and 50,000 UTF-16 units per text. Empty lines and whitespace are significant.

How it works

Exact case-sensitive line comparison using a longest common subsequence. Line endings are normalized to LF; spaces, case and trailing empty lines remain significant. A changed line is a deletion plus an insertion. When several optimal comparisons exist, deletions take precedence. Each input is limited to 50,000 UTF-16 units and 500 lines. An empty input has zero lines.

How to read the comparison

Unchanged lines are shown with their original and revised line numbers. Deleted lines have a minus label; inserted lines have a plus label. A final line break creates a trailing empty line. CRLF, CR and LF are treated as the same line ending, but all other characters are compared exactly. This is a line comparison, not a word-level comparison or a patch file.

For example, changing Draft version to Final version produces one deletion and one insertion. Choose Changes only to hide unchanged lines, or Deletions only or Insertions only to isolate one type of change. In the sample above, Changes only shows three of five rows: one deletion and two insertions. The full comparison counts and original line numbers stay the same in every view. Use Copy comparison summary to copy the five counts as tab-separated Metric and Value columns, without either source text. For example, replacing Orange with Pear between unchanged Apple and Banana lines gives 2 unchanged, 1 deleted and 1 inserted; Changes only shows 2 of 4 total rows. Even an empty view has a valid summary. Repeated lines may have multiple equally short alignments; this tool consistently chooses a deletion first when tied. The algorithm uses at most 250,000 line-pair comparisons and a bounded table of 251,001 entries. Related: Find and replace text ยท Add line numbers.

Other tools

Text utilities

Encoding and conversion

Typography

Character and case tools