Text Diff Checker

Compare two blocks of text line by line and see exactly what changed.

What is it?

This tool compares two blocks of text line by line and shows exactly which lines were added, removed, or stayed the same, entirely in your browser.

Formula Explanation

The comparison uses a longest-common-subsequence (LCS) algorithm — the same underlying approach used by tools like git diff — to find the smallest possible set of added and removed lines that explains the difference between the two texts, rather than just comparing line-by-line at matching positions.

Example Calculation

Comparing "jumps over the lazy dog." to "jumps over the lazy cat." shows that exact line as both removed (old version) and added (new version), even though only one word changed, since this tool compares whole lines rather than individual words.

How to Use

  1. Paste or type the original text on the left.
  2. Paste or type the changed text on the right.
  3. Click Compare to see line-by-line differences.
  4. Green lines (+) were added, red lines (-) were removed, and plain lines are unchanged.

Benefits

  • Finds the smallest set of changes between two texts, not just a naive line-by-line comparison.
  • Processes everything locally in your browser — your text is never sent anywhere.
  • Shows a quick added/removed count alongside the full line-by-line breakdown.

Use Cases

  • Checking exactly what changed between two drafts of a document.
  • Comparing two versions of a config file or code snippet.
  • Reviewing edits before merging or approving a change.

What Your Result Means

Each line is marked as unchanged, removed (present in the original but not the changed text), or added (present in the changed text but not the original). A line that was edited shows up as one removed line plus one added line, since the comparison works on whole lines.

Tips

  • For a cleaner diff, make sure both texts use consistent line breaks — inconsistent wrapping can make similar lines look different.
  • This compares whole lines, so a single-word change still shows the whole line as removed + added.
  • Very long texts (thousands of lines) may take a moment or hit the length limit — try comparing smaller sections.

Common Mistakes

  • Expecting word-level highlighting within a changed line — this tool compares at the line level, not the word level.
  • Comparing texts with very different line-wrapping, which can make otherwise-similar content show up as fully different lines.
  • Pasting extremely long documents, which may hit the built-in size guard.

FAQs

Is my text sent anywhere?

No, the comparison runs entirely locally in your browser using JavaScript — nothing is uploaded to a server.

Does this compare word-by-word or line-by-line?

Line-by-line — if only one word in a line changes, that whole line shows as removed (old) and added (new), not just the changed word.

Is this the same algorithm git diff uses?

It's the same family of approach — a longest-common-subsequence based diff — though git's actual diff implementation includes additional heuristics for readability.

Is there a size limit?

Yes — extremely long texts are blocked with a message asking you to compare a shorter excerpt, since the comparison algorithm's cost grows with both texts' combined line count.

Text is compared locally in your browser and is never uploaded to a server.

Last updated: August 1, 2026