Text compare
Client-side only. Both texts stay in this tab. Nothing is uploaded.
Removed or old lineAdded or new lineExact words that changed
Reading the result
Paste the older version on the left and the newer one on the right, then hit Compare. Every line lands in one of four buckets, and the counters above the result tell you how many of each you have before you start scrolling.
| Bucket | How it looks | What happened |
|---|---|---|
| Unchanged | No colour | The line exists in both versions, in the same order. |
| Changed | Red left, green right, darker words inside | A removed line sits right where a new one was added, so they are paired and the exact words that differ are marked. |
| Added | Green right, grey gap left | New in the changed text, with nothing on the left to pair it with. |
| Removed | Red left, grey gap right | Gone from the changed text. |
Side by side is easiest for prose and contracts. Unified stacks old and new lines in one column, which reads better on a phone. Patch text is the raw diff -u output you can paste into a ticket or download as changes.diff.
Worked example: one nginx block, before and after HTTPS
Click Load sample. The left side is a plain HTTP server block. The right side is the same block after someone switched it to HTTPS and touched a few other lines on the way. With every option off, the counters read:
- 1 line added: the new
ssl_certificateline (line 5 on the right). - 0 lines removed.
- 3 lines changed:
listen 80becamelisten 443 ssl, thetry_filesfallback went from=404to/index.html, andgzip onpicked up two extra spaces. - 8 lines unchanged.
Now tick Ignore whitespace. The gzip line drops out, changed goes to 2, and unchanged goes to 9. That is the whole point of the option: the extra spaces are noise, while the try_files change is a real behaviour change (missing files now serve your app shell instead of a 404) and deserves a second look. Switch to Patch text to get the version you would paste into a review:
--- original
+++ changed
@@ -1,10 +1,11 @@
server {
- listen 80;
+ listen 443 ssl;
server_name example.com www.example.com;
root /var/www/html;
+ ssl_certificate /etc/ssl/example.pem;
location / {
- try_files $uri $uri/ =404;
+ try_files $uri $uri/ /index.html;
}
gzip on;
Why moved text shows up twice
This page uses the Myers algorithm, the same family git uses by default. It looks for the shortest list of deletions and insertions that turns the left text into the right one, keeping every shared line in its original order. Order is the catch. If you cut a paragraph from the top of a document and paste it at the bottom, the tool cannot say "moved". It reports the paragraph once as removed (where it was) and once as added (where it went).
The same rule explains a few other surprises. Re-wrapping a paragraph at a different width changes every line in it, even though no word changed, so compare prose with one sentence or paragraph per line when you can. Sorting a list before comparing (try sort lines) turns a reordered list into a clean "nothing changed".
When each ignore option helps and when it hides something
- Ignore whitespace collapses runs of spaces and tabs to one space and trims each line before comparing. Good for HTML, prose, and SQL. Risky for Python, YAML, and Makefiles, where indentation is meaning.
- Ignore case folds letters to lower case for the comparison only. Good for keyword lists and SQL keywords. Risky for passwords, identifiers, and anything case sensitive like URL paths.
- Ignore blank lines skips empty and whitespace-only lines entirely, so adding a spacer line does not count as a change. Line numbers still refer to the original text.
- Only show changes folds long unchanged stretches down to three lines of context on each side, which is what you want for a 2,000 line config with two edits.
In every case the screen still shows your original text. The options only change what counts as equal.
What it will not do
- No three-way merge and no "accept this change" buttons. Use your editor or git for that.
- No file or folder compare. Paste text. For two files on disk,
diff -u old neworgit diff --no-index old newdoes the same job. - Word highlighting runs on paired lines only. An added or removed line is shown whole.
- No moved-block detection, for the reason above.
- If the texts differ in more than 3,000 places, it stops looking for the smallest diff and marks the differing block as replaced, so the tab stays responsive. The page says so when that happens.
- Checking whether two lists contain the same items regardless of order is a different job. Run each list through the duplicate line checker and sort lines first, then compare.
FAQ
Is my text uploaded anywhere?
No. Both boxes are compared by JavaScript in this tab. There is no server step, so it is fine for contracts, configs, and other text you would not paste into a random website.
Why does a line I only moved show up as removed and added?
A line diff keeps order. It finds the longest run of lines both versions share in the same sequence and reports everything else as edits. A paragraph that moved from the top to the bottom is not in sequence any more, so it appears once as removed and once as added. git diff and diff -u behave the same way.
What does ignore whitespace actually ignore?
Before comparing, each line has runs of spaces and tabs collapsed to one space and its ends trimmed. The display still shows the original text. That hides indentation changes, which is what you want for prose and HTML but can hide a real bug in Python, YAML, or Makefiles.
Can I save the result as a patch file?
Yes. Download saves a unified diff (.diff) with three lines of context, the same format diff -u and git diff print. The header names are placeholders, so change the --- and +++ lines to the real file path before applying it with the patch command.
How large can the two texts be?
Tens of thousands of lines are fine when the versions are mostly similar. If the two texts differ in more than 3,000 places, the tool stops searching for the smallest diff and marks the differing block as replaced, so the tab does not freeze.