Skip to content

Compare text

See what changed between two versions of a text, line by line.

Updated

How to compare two texts

  1. Paste the original version on the left and the changed version on the right.
  2. Read the result below: + lines were added, − lines were removed.
  3. Turn on Only show changes to skip the unchanged lines in long documents.
  4. Use Copy diff to share the result.

Reading the result

MarkMeaning
+The line is only in the changed text: it was added.
−The line is only in the original text: it was removed.
(no mark)The line is in both texts, unchanged.

The two columns of numbers are the line's position in the original and in the changed text, so you can find it in either version.

Common uses

  • Checking an editor's changes. Paste your draft and the edited version of a document or contract to see exactly which lines were added or removed.
  • Comparing two config files. Find what differs between two versions of a config file or code snippet. Ignore whitespace hides changes that are only re-indentation.
  • Two exports of the same data. Spot the one line that differs between two exports or lists. Only show changes skips everything that matches.

Questions

How does the comparison work?

It uses the Myers diff algorithm, the same one behind git diff, to find the smallest set of added and removed lines that turns the original into the changed version.

Why is a changed line shown as removed and added?

The comparison works on whole lines, so an edited line appears as the old line removed and the new line added, right next to each other.

What do “Ignore case” and “Ignore whitespace” do?

They treat lines as equal when they differ only in capital letters, or only in spaces at the ends and runs of spaces in between. Useful for reformatted code or re-typed lists.

Can I copy the result?

Yes. “Copy diff” copies every line prefixed with + for added, - for removed and a space for unchanged, ready to paste into a message or issue.

All text tools →