How to compare two texts or strings online

Two files that look identical usually differ by something invisible: a trailing space, a smart quote, a Windows line ending. A diff finds it in a second.

Compare two texts in three steps

  1. Open Text diff — nothing you paste leaves your browser.
  2. Paste the original version on one side and the new version on the other.
  3. Read the highlighted lines: added, removed and changed are colour-coded.

Differences people miss

  • Trailing whitespace — invisible in most editors, but it breaks string equality checks.
  • Line endings — Windows uses CRLF, macOS and Linux use LF, so every line can look "changed".
  • Smart quotes and dashes — a word processor silently swaps " for and - for .
  • Non-breaking spaces — copied from web pages, they look exactly like a normal space.
  • CaseID and id are different strings almost everywhere except a case-insensitive comparison.
  • Zero-width characters — pasted from PDFs and chat apps, they show up as a change with no visible cause.

Comparing structured data

JSON and code are order-sensitive as text but not always as data. Normalise before diffing: run both sides through JSON formatter so indentation and key spacing match, then compare. For plain strings where you only care about "same or not", hashing both with Hash generator gives a yes/no answer instantly — identical text always produces an identical SHA-256.

FAQ

Is the comparison private?

Yes — the diff is computed in JavaScript inside your tab. Nothing is uploaded, logged or stored, which matters when you are comparing contracts or configuration.

Can I compare two files instead of pasted text?

Open each file in Universal file preview, copy the contents, and paste both sides into the diff. For PDFs, run Extract PDF text first.

Is there a size limit?

No hard limit, but very large inputs (hundreds of thousands of lines) are limited by your device's memory rather than by us.

Tools: Text diff · JSON formatter · Hash generator

← Back to Learn