Text

Text Diff Compare

Compare two blocks of text line by line and see exactly what was added and removed.

Privacy: This tool runs entirely in your browser. Your data never leaves your device and is never uploaded to any server.

+0 added−0 removed

How to use this text diff tool

  • Paste the original text on one side and the changed text on the other.
  • Everything that differs is highlighted immediately.
  • Scan added and removed lines, or copy the result.
  • Comparison runs in your browser; nothing is uploaded.

Reading a diff

Once you know what to look for, a diff is faster to read than the text itself.

You seeIt meansWhat to do
A green blockContent that exists only in the new versionCheck the addition was intentional
A red blockContent that exists only in the old versionConfirm the removal was on purpose
Red and green around the same linesThe lines were edited rather than added or removedRead them as a pair
One enormous changeLine endings or encoding differ between the two textsNormalise the line endings and compare again

How a diff is calculated

The two texts are split into lines and compared using a longest common subsequence algorithm.

The output is the shortest set of additions and deletions that turns one version into the other. The same idea powers git diff and every code review tool.

Line, word or character

Line level is the right granularity for code, config and documents, because that is how people edit.

Word and character level is better for a single long sentence, such as a contract clause or a translation, where whole-line changes hide the real detail.

What the colours mean

  • Green — present in the new version but not the old.
  • Red — present in the old version but removed.
  • Uncoloured — identical in both.
  • A line that looks changed on both sides usually means it was edited rather than added.

Typical uses

  • Reviewing an edited document without reading it end to end.
  • Checking what a format or script changed in a config file.
  • Comparing two API responses before and after a deploy.
  • Spotting a single altered character in a long block of text.

Frequently asked questions

How does the comparison work?

The two texts are split into lines and compared using a longest-common-subsequence algorithm.

What do the colors mean?

Green lines were added, red lines were removed, and uncolored lines are unchanged.

Is my text uploaded?

No. The comparison happens locally in your browser.

Does it ignore whitespace or letter case?

No. It compares line by line exactly, so a change in indentation or case counts as a change. Normalise the text first if that gets in the way.

Can I compare two whole files?

Yes. Paste the contents of each file into the two panes — the comparison is text-based, so the file names do not matter.

How large a text can it handle?

Line-by-line diffing is quick for ordinary documents. Two very large files take longer, because the algorithm evaluates lines against each other.

More Text tools