Compare Two Texts — See What Was Added and Removed

Paste the original text on one side and the changed text on the other to see exactly what was added and removed, compared by line, by word or by character.

Live demo · real result from this tool
Compare
Added2 lines
Removed
1 lines
Unchanged
3 lines

Line by line

Old #New #ChangeLine
11The quick brown fox
2− removedjumps over
2+ addedleaps over
33the lazy dog.
4+ addedA new line.
45The end.

Unified diff

===================================================================--- original+++ changed@@ -1,4 +1,5 @@ The quick brown fox-jumps over+leaps over the lazy dog.+A new line. The end. 

Processed on your device — nothing is uploaded.

How to use the text comparison tool

  1. Paste the earlier version into Original.
  2. Paste the later version into Changed.
  3. Choose how to Compare: Lines, Words or Characters.
  4. Tick Ignore case or Ignore leading and trailing spaces if those differences do not matter to you.
  5. Read the counts and the highlighted changes. In Lines mode, download the table or the unified diff if you need to keep a record.

What it does and when to use it

When two versions of a text come back to you, the hard question is not whether they differ but where. This tool answers it. Typical uses:

  • Seeing what an editor or a client changed in a piece of copy.
  • Checking what changed between two versions of a contract, policy or terms page.
  • Confirming that a find-and-replace did only what you meant.
  • Comparing an exported list with the one you sent.

Changes are colour coded: additions in green and removals in red. Words mode is the best fit for prose. For code and config files, the Diff Checker in the Developer Studio is built around that job.

How it works

The tool uses the open-source diff library, which runs inside your browser. In Lines mode it finds the longest run of lines the two versions share, then marks everything else as added or removed. Because lines are matched by content, not by position, adding one line at the top does not make every line below it look changed.

The ignore options change how lines are matched, not what you see. The original text is always shown, so you never lose the real wording. Words and Characters modes work the same way on smaller pieces and mark changes inline. They also write a plain-text version, where [-text-] means removed and {+text+} means added.

If two very large or very different texts cannot be compared within about four seconds, the tool falls back to comparing lines by position and shows a warning.

Worked examples

Lines mode. The original has four lines: “The quick brown fox / jumps over / the lazy dog. / The end.” The changed text swaps “jumps over” for “leaps over” and adds “A new line.” before the last line. The result is Added: 2 lines, Removed: 1 line and Unchanged: 3 lines. The edited line counts once as removed and once as added.

Words mode. “Delivery in 5 days.” against “Delivery in 3 working days.” gives 2 words added and 1 removed, shown as Delivery in [-5-]{+3 working+} days.

Ignoring case and spaces. “Hello World” against “hello world” with two trailing spaces, with both ignore options ticked, gives The two texts are identical.

Limits and tips

  • The line table shows up to 5,000 lines.
  • Line endings and spaces inside a line count as changes. Use Remove Extra Spaces on both texts first if spacing is not important.
  • For prose in Lines mode, putting one sentence on each line makes the diff much easier to read. The Text Splitter can split on full stops for you.
  • To check the length of each version, use the Character Counter. To clean repeated entries from a list before comparing, use Remove Duplicate Lines.

Frequently asked questions

Which compare mode should I use?
Use Lines for code, lists and anything with short lines. Use Words for prose, where a paragraph is one long line and you want to see the few words that changed. Use Characters for short strings such as codes, IDs or a single sentence.
Why is a whole line marked as removed and added?
In Lines mode, a line that changed at all counts as one line removed and one line added. Switch to Words or Characters to see the exact change inside the line.
Do spaces and capital letters count as changes?
Yes, by default. Tick Ignore case and Ignore leading and trailing spaces to skip those differences. Spaces in the middle of a line still count.
Can I save the result?
In Lines mode you can download the line-by-line table as a CSV file and, when neither ignore option is on, a unified .diff file. The .diff uses the same format as git and most code review tools.
Is it safe to paste a contract or private document?
Yes. The comparison runs in your browser and neither text is uploaded.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close