Skip to content
TextDiff

Text Diff

Compare two texts side-by-side — additions, deletions, and unchanged lines highlighted. Runs entirely in your browser.

Ctrl + Enter to compare

How text diff works

This tool uses the Myers diff algorithm, the same algorithm used by git diff and most version control systems. Given two sequences of lines, it finds the shortest edit script (SES) — the minimum number of insertions and deletions needed to transform text A into text B.

The output uses a unified diff-style display:

  • Lines highlighted in green exist only in the modified text (added).
  • Lines highlighted in red exist only in the original text (removed).
  • Uncolored lines exist in both texts (unchanged).

Common text diff use cases

  • Comparing two versions of a document, contract, or essay before and after edits.
  • Checking what changed in a configuration file between environments.
  • Verifying that a code transformation (minification, formatting, transpilation) only changed what was expected.
  • Comparing API responses to find unexpected changes in payload structure.
  • Reviewing student submissions vs. a reference answer.

Developer Guides