You send a draft to an editor and it comes back changed. A colleague updates a contract and says only "small edits". Someone modifies a function and nobody remembers how. In each case the question is the same: what exactly is different? Reading both versions side by side is slow and you will miss things. A comparison tool finds every change in a second and shows it to you in colour.

What a text diff does

A diff lines up two pieces of text and marks what changed between them. Anything that appears only in the new version is an addition, shown in green. Anything that was in the old version but is gone is a deletion, shown in red. Everything that is identical stays in grey, so the changes stand out.

How to compare two texts

  1. Open the Text Diff tool.
  2. Paste the original text into the left box.
  3. Paste the revised text into the right box.
  4. Read the result. It updates as you type, so there is no button to press.
  5. Pick a mode and set the options if you need to.
  6. Use Copy diff to copy the plain-text result, or Swap to reverse the comparison.

Choosing the right mode

  • Line by line compares whole lines. It is best for code, CSV data, log files and any content where each line is a meaningful unit.
  • Word by word compares individual words. It is best for articles, emails and other prose, where the wording matters more than where the lines break.
  • Character by character compares every character. It is the right choice for catching tiny changes, such as an extra space, a swapped letter or a different punctuation mark.

If the line mode shows a whole paragraph as changed when you only edited one word, switch to word mode and the real change will appear on its own.

Two options that cut the noise

  • Ignore case treats capital and lowercase letters as the same, so a changed heading style is not flagged as a rewrite.
  • Ignore extra whitespace skips differences that are only spacing or indentation, which is useful when comparing code that was reformatted.

What people compare

  • Document versions: paste the old and new text and see exactly what changed.
  • Edits to your writing: check what an editor or a proofreader altered in your draft.
  • Code: compare a function before and after a change. Line mode works best.
  • Data exports: compare two CSV files or two outputs from a system.
  • Translations: compare the structure of a source and a translated text.
  • Agreements: see which clauses were added or removed between two versions. For anything legal, a lawyer should still review the final text.

Getting a clean result

  • Paste the plain text of both versions. Text copied from different sources can carry different spacing, which shows up as changes.
  • If the diff looks wildly different, check that you pasted the right versions in the right boxes.
  • Remove repeated lines first with the Remove Duplicate Lines tool if the order of your list does not matter and you only want to see what is unique.

Large texts

The comparison runs in your browser using a standard longest common subsequence method. That works well for most documents. For very large inputs, more than about 5,000 lines, switch to word or character mode, or compare smaller sections one at a time.

Privacy

Drafts, contracts and code are often confidential. The comparison runs entirely in your browser, so nothing you paste is uploaded or stored.

Spot every change

The Text Diff tool is free, updates as you type and keeps your text on your device.

← All articles

More articles