Free · No sign-up · Data stays local

Text Diff Tool

Free online text diff: compare two passages line by line, mark added, removed and unchanged lines, and report counts plus a similarity score.

差异结果(- 为 A 独有,+ 为 B 独有)
新增行
0
删除行
0
相同行
0
相似度
—

How to Use

  1. Paste both passages

    Put the original on the left and the revision on the right; results update as you type.

  2. Set comparison options

    Tick ignore-whitespace or ignore-empty-lines as needed, or click 'Swap sides' to flip the direction.

  3. Read the diff stats

    The panel reports added, removed and unchanged lines plus similarity; copy the diff when you are done.

FAQ

How is similarity calculated?

Similarity = 2 × unchanged lines ÷ (lines in A + lines in B), shown as a percentage. Identical inputs give 100%.

Why not just compare line by line in order?

The tool uses the longest common subsequence (LCS) algorithm, so insertions and deletions in the middle still align later identical lines correctly instead of cascading false changes.

Can I ignore whitespace and blank lines?

Yes. 'Ignore leading/trailing whitespace' trims each line first, and 'Ignore empty lines' skips blank lines before comparing — useful after formatting changes.

How much text can it handle?

A few thousand lines is fine. When the line-count product gets too large it falls back to a faster set-based comparison so the page stays responsive.

More Online Tools