Text Compare

Compare two texts and highlight every difference

Paste two versions of a text, document or code and see exactly what changed - added, removed and changed lines side by side, with the changed words highlighted. Compare by line, word or character, ignore case or spacing, and download the differences as a .diff file.
Try an example:

About Text Compare

How it works

  1. Both texts are split into lines (or words, or characters) and compared with the Myers diff algorithm - the same method used by git and most code review tools - to find the smallest set of changes.
  2. In line mode, a removed line followed by an added line is shown as one changed line, side by side, with the exact words that changed highlighted inside it.
  3. Ignore case and Ignore extra spaces make "Hello World" and "hello world" count as the same, which is handy for copy-pasted text.
  4. The counts show how many lines (or words) were added, removed, changed and unchanged, plus an overall similarity percentage.
  5. Copy diff gives a standard unified diff (patch) you can paste into an email, a ticket or apply with git.

What you need

  • Two texts to compare: paste them, type them, or open a text file on each side (code, CSV, JSON, Markdown and other plain-text files).

Tips

  • Use Lines for code, lists, CSV and configuration files; Words for prose and documents; Characters to spot a single typo or a changed digit.
  • Turn on Ignore extra spaces when one version was re-indented or copied from a PDF or email.
  • Swap the two sides to see the change in the other direction.
  • The comparison updates as you type, so you can fix differences and watch them disappear.

Limitations

  • Only plain text is compared. For Word or PDF files, copy the text out of the document first - formatting differences are not detected.
  • Very large texts are compared by line only (word and character comparisons are limited to keep your browser responsive).
  • Moved blocks are shown as removed in one place and added in another.

Runs in your browser. Both texts are compared in your browser and never uploaded - safe for contracts, code and other private documents.

Frequently asked questions

How do I compare two texts for differences?+

Paste the original on the left and the new version on the right. Differences appear instantly below: green for added, red for removed and amber for changed lines, with the changed words highlighted.

Can I compare two files?+

Yes - use "Open file" above each box to load a plain-text file (code, CSV, JSON, Markdown, logs and so on). The files are read by your browser and never uploaded.

What is the difference between Lines, Words and Characters?+

They set how finely the texts are compared. Lines is best for code and lists, Words for documents and sentences, and Characters to find tiny differences like a single wrong letter or digit.

What is a .diff (unified diff) file?+

A standard text format that lists changes with - for removed and + for added lines, plus a few lines of context. Developers use it to share and apply changes, for example with git apply or patch.

Is this a plagiarism checker?+

No. It compares two texts you provide. A plagiarism checker searches the web or a database for matching text, which this tool does not do.