Skip to main content

Text Compare

Compare two texts and see exactly what changed — added, removed and edited lines highlighted inline, plus a copyable unified diff. Runs entirely in your browser.

Input

Drop a file or browse
One file · text
Compare with
Drop a file or browse
One file · text

Output

Enter both texts to see the differences.

Unified diff
 

Standard unified diff with 3 lines of context — empty when the texts are identical.

Diff HTML
 
Summary
MetricValue
No data yet
Was this helpful?

Guides

Paste two versions of a text and see exactly what changed. Text Compare highlights removed words in red and added words in green, line by line, and hands you a copyable unified diff — the same --- / +++ / @@ format Git and patch speak.

It is built for the everyday "which of these two is newer?" moment: two drafts of an article, two copies of a config file, an email before and after an edit, a contract and its revision, or a block of code someone pasted into chat.

How to use it

  1. Paste your original text into First text (or drop a .txt file onto the uploader).
  2. Paste the revised version into Text to compare.
  3. The diff appears instantly — no button to press.

You get three results:

  • Text diff result — an inline view. Deleted content is struck through in red, inserted content is underlined in green. When a line was edited rather than replaced wholesale, only the changed words are marked, so a one-word fix doesn't light up the whole paragraph.
  • Unified diff — plain text with three lines of context, ready to paste into a ticket, a code review, or git apply.
  • Summary — how many lines were added, removed and left untouched.

How does the comparison work?

Both texts are split into lines, and a longest-common-subsequence (LCS) algorithm finds the largest set of lines that appear in both, in the same order. Anything outside that set is an addition or a deletion. Where an equal number of lines was removed and added, each pair is compared again at word level, which is what produces the word-precise highlighting.

Does it compare word by word or line by line?

Both. The structure of the diff is line-based (that's what makes a valid unified diff), and edited lines are then refined word by word inside the inline view.

Can I compare files instead of pasting?

Yes — each side has a file uploader that reads a plain-text file straight into the box. Nothing is uploaded anywhere; the file is read in your browser.

Is there a size limit?

The diff is capped at 2,000 lines per side. Beyond that, the comparison gets slow enough to freeze the page, so the tool tells you instead of hanging.

Why do my texts show as different when they look identical?

Usually trailing whitespace or a different line ending. Windows CRLF and Unix LF endings are normalized before comparing, so those won't trip it up — but trailing spaces and tabs vs. spaces will, because in code and config files that difference is often the bug.

Is my text private?

Yes. The comparison runs entirely in your browser — your text is never sent to our servers, never logged, and never stored. You can disconnect from the internet and the tool still works.

textdiffcompareunified diffchanges

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/text-compare \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstText": "Hello World! This is a test.\nThis is another tes…",
    "textToCompare": "Hello! This is another test.\nThis is a third tes…"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `text-compare` tool (Text Compare) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Part of a workflow

All collections

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.