Text Diff Tool

Compare two texts and see the differences highlighted line by line. Shows added, removed and unchanged lines with summary stats

1 lines
1 lines

How to Compare Two Pieces of Text

Paste your original on the left, the new version on the right, and the tool walks both inputs line by line and marks each line as added, removed, or unchanged. Removed lines highlight red, added lines highlight green, and matching lines stay neutral. The summary above the result tells you exactly how many of each appear, so you can spot at a glance whether an edit changed two lines or twenty.

The comparison runs on whole lines, not characters or words. That matters when you are diffing prose: rewording a sentence shows as one line removed and one line added, even if 90% of the words match. For paragraph-level edits this is what you want; for tracking individual word changes inside a sentence, copy the two lines into a [find and replace](/find-and-replace) workflow instead. The diff also treats whitespace as significant, so a line with trailing spaces will not match a line without them. Run the text through the [whitespace remover](/whitespace-remover) first if invisible characters are tripping you up.

When You Actually Need a Diff

Three situations come up most often. First, comparing two contract drafts a lawyer sent back, where you need to know which clauses moved. Second, checking what a copy editor changed in your article. Third, debugging two configuration files when one works and one does not. In all three the goal is the same: see only the changes, ignore the bulk of the text that did not move.

A worked example: you sent a 600-word blog post to an editor and got back a version with no track changes. Pasting both into the diff shows 14 lines unchanged, 6 removed, 8 added. You can now read just those 14 lines of edits in 30 seconds instead of re-reading the whole post and trying to remember the original. For longer documents this can save 10 to 20 minutes per review cycle.

Reading the Summary Stats

The header above the diff shows three counters: lines unchanged, lines added, lines removed. A small edit might give you 38 unchanged, 2 added, 2 removed. A heavy rewrite of the same source might show 5 unchanged, 35 added, 33 removed. The ratio between unchanged and changed lines is a quick proxy for how much real work happened on the document.

Watch out for one common gotcha. If the original has Windows line endings (CRLF) and the modified version has Unix line endings (LF), every single line will appear changed because the invisible carriage returns do not match. The fix is to paste both into a plain text editor first, save with consistent line endings, and re-run the comparison. The [whitespace remover](/whitespace-remover) will not fix this on its own; use a text editor's line-ending conversion.

Privacy and What Happens to Your Text

Both texts you paste in stay on your device. The diff calculation runs entirely in your browser using JavaScript, so nothing is uploaded to a server, logged, or stored after you close the tab. That makes the tool safe for confidential drafts, contracts, and code that should never leave your machine.

If you are working on something sensitive, you can run the tool offline by loading the page once with the network on, then disconnecting. The diff will keep working because all the logic is already in your browser. There is no server-side fallback, no telemetry on the text content, and no ad network reading the textareas.

Frequently Asked Questions

Can it diff documents longer than a few thousand words?

Yes, but the rendering slows down past about 5,000 lines because the browser has to paint every coloured row. For very large files (entire codebases, books) a desktop diff tool like Beyond Compare or Meld will be faster. For most articles, contracts, emails, and configuration files this tool handles them in under a second.

Why does it show two lines as different when they look identical?

Almost always invisible whitespace. Trailing spaces, tabs versus spaces, or different line-ending conventions (CRLF vs LF) make lines unequal even when they look the same. Run both texts through the [whitespace remover](/whitespace-remover) with 'Trim lines' enabled, then compare again.

Does it work as a code diff?

It works for any plain text including code, but it only diffs whole lines, not tokens or syntax. For serious code review use git diff or a code-aware tool like Diffchecker; for quick checks of two pasted snippets this tool is fine. It will not understand that swapping the order of two function arguments is a meaningful change.

Can I share the diff with someone else?

Not as a link. The text never leaves your browser, so there is no server-side state to share. To share results, take a screenshot of the diff or copy both texts and the summary into an email. If you need a shareable link, GitHub Gist is a free option and provides proper diff URLs.

More tools β†’