Text Diff

Compare two versions of any text and see exactly what changed. Lines are matched intelligently, additions shown in green and removals in red, with a clear summary of how much changed. Useful for configs, code, drafts and copy — all processed locally in your browser.

Differences Green = added · Red = removed

How to use the text diff tool

  1. Paste the original text on the left and the modified version on the right.
  2. Choose how much surrounding context you want to see around each change.
  3. Click Compare (results also update automatically as you type). Removed lines appear in red, added lines in green.

Features

How a diff works

A diff finds the smallest sensible set of edits that turns the original text into the modified one. First the two texts are split into lines; the algorithm then aligns identical lines (the common subsequence) and reports the rest as removals and additions. Tools like git diff work on the same principle — this page gives you the same insight without needing a repository.

Frequently asked questions

Is my text uploaded anywhere?

No. Both texts are compared locally in your browser using JavaScript. Nothing you paste is transmitted — you can even use it offline.

Why does a whole block show as removed and re-added instead of one changed line?

That happens when the middle lines changed enough that the algorithm can no longer align them with the original. Toggling ignore whitespace helps when the only difference is indentation. For genuinely rewritten blocks, a large red/green chunk is the honest answer.

Can I use it for large files?

Yes, with sensible limits. The page processes up to a few thousand lines; extremely large inputs switch to a fast prefix/suffix comparison so the page stays responsive. For very big repository diffs you're better served by git diff or a dedicated diff app.

Does it compare whole lines or individual words?

This version compares line by line, which is the clearest view for code and structured text. For paragraph edits in prose, line-level diff plus a couple of context lines is usually enough to spot the change.