Text comparison

Paste the original and the changed text to see what was added, what was removed and what was modified. Differences are marked with + and − signs, underline and strike-through rather than colour alone, and every line is shown in its own direction whether it is Arabic or English. Use this text compare tool for contracts, articles, lists or code, or to see what changed between two versions of a file.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Paste the original text into the first box and the changed text into the second.
  2. Choose the comparison level: lines, words or characters, and ignore case or whitespace if needed.
  3. Press “Compare” (short texts are compared automatically) and choose the unified or side-by-side view.
  4. Read the summary, then copy the plain-text result or download it.

Example

The built-in example compares a 5-line shop description with an edited copy: the price changed from 100 to 120, the free-shipping line was removed, the return period changed from 7 to 14 days and a cash-on-delivery line was added.

Comparing by lines gives: 3 lines added (+) and 3 removed (−), of which 2 are modified lines shown as a −/+ pair with the changed words highlighted (100 → 120 and 7 → 14), and 2 unchanged lines. The plain-text result is a unified diff with the position line “@@ -1,5 +1,5 @@”.

Limits and caveats

  • Line comparison was tested with two texts of 100,000 lines each (about 1.5 MB per text) and hundreds of edits: the comparison takes about a second, only the first 2,000 rows are drawn on screen, and the plain-text result contains every difference. Pasting a text of that size makes the browser text box itself take several seconds. Above about 4,000 lines or 150,000 characters the text box shows every line in one direction (taken from its first letter) instead of a direction per line, because per-line direction makes the browser extremely slow at that size.
  • The comparison runs on the page itself, so it stops after 2.5 seconds when the texts are large and very different, and shows a message instead of a partial result. Character comparison suits short texts (thousands of characters); line comparison is the right choice for large texts.
  • In line comparison, different line endings (CRLF and LF) and a final empty line are not differences. Two lines count as “modified” when they share at least half of their words; otherwise they are shown as a separate removal and addition.
  • Matching is literal: a word with Arabic diacritics differs from the bare word, and “أ” differs from “ا”. The ignore-case option affects Latin and similar scripts only.

Questions about this tool

What is the difference between line, word and character comparison?

Line comparison suits lists, code and long files and produces a standard diff. Word comparison suits paragraphs because only the changed words are highlighted inside the text. Character comparison shows a changed letter or diacritic inside a word; an Arabic letter with its diacritics and a combined emoji are treated as one unit and never split.

How do I read the plain-text result?

For lines it is the well-known unified diff format: a line starting with − exists only in the original, a line starting with + exists only in the changed text, a line starting with a space is unchanged, and @@ lines give the line numbers. For words and characters, removed text appears as [-text-] and added text as {+text+} inside the text.

Are my texts uploaded to a server?

No. The whole comparison runs inside your browser. Neither text is stored or sent anywhere.

How do I compare two texts and find the differences?

Paste the original into the first box and the changed text into the second; short texts are compared at once and large ones when you press “Compare”. Additions are marked with + and removals with −, and the summary counts the added, removed, modified and unchanged lines. The built-in example, for instance, shows 3 lines added and 3 removed, 2 of them modified.

Can text compare ignore whitespace and letter case?

Yes. Tick “Ignore whitespace differences” and “Ignore case” before comparing. With the first option, line comparison treats a line that differs only in the number of spaces, or in a trailing space, as unchanged; with the second, Hello and hello are equal. Neither option ignores Arabic diacritics or the difference between “أ” and “ا”.