TanodTools

Compare text (diff checker)

Paste an original and a changed version to see exactly what was added and removed.

Runs entirely in your browser

Compare by
View

Line comparison handles about 10,000 lines per side. Word and character comparison is limited to about 300,000 characters in total.

How to compare two texts

  1. Paste the original into the left box and the changed version into the right box.
  2. Choose whether to compare by lines, words or characters, and side by side or inline.
  3. Press Compare. Additions are marked with a plus on a green tint; removals are struck through on a grey tint.

How the comparison works

A diff finds the shortest list of edits that turns the original into the changed text. Matching stretches are left alone; what is left over is shown as removed from the original and added in the new version. This tool uses the open-source jsdiff library, which runs in your browser.

When a block of lines is replaced, the old and new versions are shown on the same rows in side-by-side view so you can read them across. On a phone the two sides stack. "Open a .txt file" fills whichever box you used last.

Tips

  • Compare lists after cleaning them with Remove duplicate lines.
  • Make the same edit everywhere first with Find and replace.
  • Comparing two data exports? Convert them first with JSON to CSV so each record sits on one line.
  • Press Swap to see the comparison the other way round.

Questions

Which comparison should I choose?

Lines is best for code, lists and configuration files and is the fastest. Words suits prose, where a small edit would otherwise mark a whole line as changed. Characters shows the smallest edits, such as a changed digit or a typo.

How are changes marked?

Added text has a plus sign and a green tint. Removed text has a minus sign, a grey tint and a line through it. The sign is there so the difference does not rely on colour alone.

What do Ignore case and Ignore spaces do?

Ignore case treats upper and lower case as equal. Ignore spaces (line mode only) disregards differences in spaces and tabs inside and around lines.

Why are some unchanged lines hidden?

In line mode, long runs of identical lines are folded away, keeping three lines of context around each change. Press the fold bar to show them.

How big a file can I compare?

About 10,000 lines on each side works comfortably when the texts are mostly alike. Two long texts that are completely different take much longer, and the comparison gives up with a message after a while.

Is my text uploaded?

No. The comparison runs in your browser, using the open-source jsdiff library, and the text is not stored.