Text compare

Paste two versions of a text, or open two files, to see what was added, removed and changed, down to the word. Nothing is uploaded.

How it compares

The tool finds the smallest set of lines to remove and add to turn the original into the changed text, using the difference algorithm published by Eugene Myers in 1986 (the same idea behind diff and Git). Lines that are in both texts stay in place, so a line inserted near the top does not make everything after it look different.

When a removed line and an added line sit in the same spot, they are shown as one changed line, and the tool compares them again word by word so you can see exactly which words, numbers or punctuation changed.

  • Ignore spaces and tabs treats any run of spaces or tabs as one space and ignores them at the start and end of lines. Useful for re-indented code or text copied from PDFs.
  • Ignore upper and lower case treats "Total" and "total" as the same.
  • JSON mode reads both sides as JSON, sorts the keys of every object and lays them out the same way, so only real differences in data show. If a side is not valid JSON, it tells you the line and column of the problem.
  • Unified diff: the download and copy buttons give the changes in the standard format used by diff -u, Git and code review tools.

Worked example

Original:

The quick brown fox
jumps over
the lazy dog.
End

Changed:

The quick red fox
jumps over
the lazy dog.
New line
End

Result: line 1 is changed ("brown" became "red"; the rest of the line is the same), lines 2 and 3 are unchanged, "New line" is added as line 4 of the changed text, and "End" is unchanged. Summary: 1 changed, 1 added, 0 removed. As a unified diff:

--- original
+++ changed
@@ -1,4 +1,5 @@
-The quick brown fox
+The quick red fox
 jumps over
 the lazy dog.
+New line
 End

"@@ -1,4 +1,5 @@" means: this block covers 4 lines of the original starting at line 1, and 5 lines of the changed text starting at line 1.

Tips

  • Contracts and documents: copy the text out of each version (or save as .txt) and compare. Formatting such as bold or fonts is not compared, only the words.
  • Long paragraphs count as one line each, so a small edit marks the whole paragraph as changed; the word-level highlighting then shows what changed inside it.
  • Very different texts (thousands of changed lines) are not worth a line-by-line view; the tool will say so.
  • Files are read in your browser as UTF-8 text. Word, PDF and other binary files need to be converted to text first.

FAQ

How do I compare two texts for differences?

Paste the original on the left and the new version on the right (or open two files). Removed text is highlighted on the left, added text on the right, and changed lines show the exact words that differ.

Is my text uploaded?

No. The comparison runs in your browser. Nothing you paste or open is sent anywhere or saved.

Can I compare code?

Yes. Open the two source files or paste them. Use "Ignore spaces and tabs" if only the indentation changed, and download the unified diff to share or apply with a patch tool.

Why does it say the texts differ but show no changes?

The difference is in something you chose to ignore (spaces or case), in line endings (Windows files end lines differently from Mac and Linux files), or in whether the last line ends with a line break. The tool says which.

How does JSON mode work?

Both sides are parsed as JSON, object keys are sorted alphabetically and everything is laid out with 2-space indentation before comparing. Array order still counts, because in JSON it is part of the data.

How big can the texts be?

Tens of thousands of lines work fine when the changes are modest. Very large files with thousands of changed lines can be slow on phones, and above about 6000 changed lines the tool stops and says the texts are too different.