tooly

Compare texts (diff)

Paste two versions of a text and see exactly what changed: added parts in green, removed in red, with a count of changes. Everything runs in your browser.

Everything runs in your browser — nothing is sent anywhere

How to use

  1. 1

    Paste the original text on the left and the changed text on the right.

  2. 2

    Switch between line and word comparison.

  3. 3

    Read the highlighted differences.

Where a quick text comparison pays off

Most edits are invisible once they are made. Reading two versions side by side is slow and unreliable: people routinely miss a changed digit in a price, a dropped "not", or a swapped date.

A diff does the hunting for you. Typical cases where it saves real time:

  • Checking what a counterparty changed in a contract, offer or terms before you sign.
  • Comparing two exports of the same list (emails, SKUs, IDs) to see which entries appeared or disappeared.
  • Finding why two configuration files or .env files behave differently.
  • Reviewing an edited article or translation against the original draft.

How the comparison works

The tool uses a longest-common-subsequence approach, the same family of algorithms behind git diff and the classic Unix diff. It looks for the largest possible amount of text that both versions share, keeps it as unchanged, and marks everything else as either removed from the original or added in the new version.

The output is recalculated as you type or paste, so you can fix something in either box and immediately see the effect. Removed fragments are shown in red with a strikethrough, added fragments in green, and the rest as plain text in a monospaced font so alignment in code and tables stays readable.

The counter above the result means slightly different things in each mode:

  • In line mode it counts lines: +4 / −2 means four lines were added and two removed. A line that was edited counts once as removed (the old version) and once as added (the new one).
  • In word mode it counts changed fragments rather than individual words. A rewritten phrase of six words that sits in one place counts as one removal and one addition.

Line mode versus word mode in practice

Line mode treats each line as an indivisible unit. That is the right model for anything where lines have meaning on their own: source code, CSV rows, log files, lists of names, YAML or .ini settings. It is also strict: a trailing space or a tab instead of spaces makes it a different line.

Word mode splits the text into words and punctuation and compares those. It is much better for prose, where a whole paragraph is often a single long line and a line diff would only tell you "this paragraph changed". In word mode you see exactly which words were replaced. It is also more forgiving: differences that consist only of whitespace, such as a double space between sentences, are largely ignored.

A good habit is to start in line mode to see where the changes are, then switch to word mode to read what exactly changed inside a long line.

Getting clean, readable results

Most confusing diffs come from formatting noise rather than real edits. A few things to check before comparing:

  1. Line endings and wrapping. Text copied from a PDF or an email often has hard line breaks in the middle of sentences. If one version is wrapped and the other is not, line mode will mark everything as changed. Use word mode, or remove the breaks first.
  2. Letter case. The comparison is case-sensitive, so "Invoice" and "invoice" are different. If case is irrelevant to you, normalise both texts with the case converter before pasting.
  3. Sorted vs unsorted lists. A diff is order-aware. If two lists contain the same items in a different order, it will show moves as deletions and additions. Sort both lists the same way first if you only care about membership.
  4. JSON and minified data. A minified JSON document is one enormous line. Pretty-print both versions with the JSON formatter using the same indentation, then compare line by line; each key ends up on its own line and changes become obvious.
  5. Smart quotes and dashes. Word processors replace " with typographic quotes and - with en dashes. These look identical at a glance but are different characters and show up as changes.

Size and privacy

Both texts stay in the page. Nothing is sent to a server, so comparing an unreleased contract, internal source code or a file with customer data is no different from comparing two shopping lists. Closing the tab discards everything.

Speed depends on your device and on how different the texts are. A few thousand lines compare instantly; tens of thousands of heavily changed lines can take a few seconds. If it feels sluggish, compare only the relevant section, or use line mode, which has far fewer units to match than word mode.

FAQ

Is my text uploaded?

No. The comparison runs in your browser.

Lines or words — which should I pick?

Lines for code, logs and lists; words for prose where a sentence changed slightly.

Is whitespace significant?

Yes, by default every character counts, so trailing spaces show up as changes.

Can I compare files?

Paste their contents. Very large files (tens of thousands of lines) may take a moment.

Related tools