Text Compare

Paste two versions of any text into the boxes below. The diff output highlights added lines in green, removed lines in red, and unchanged lines in gray. Runs locally in your browser.

Text Compare (none) soon Text Similarity Checker soon Alphabetical Order Sorter Email Extractor
Diff output 0 added, 0 removed, 0 unchanged

How the text comparison works

The diff engine splits each input into lines and runs the standard longest-common-subsequence (LCS) algorithm to find the longest matching sequence of lines between the two texts. Anything outside that subsequence is marked as added (only in Text B) or removed (only in Text A). Identical lines pass through unchanged.

LCS is the same algorithm that powers diff, git diff, GitHub pull-request views, and Diffchecker. It gives optimal results for line-oriented text but does not detect moved blocks (a line that gets cut from one place and pasted into another shows up as one delete + one insert, not as a move). For most editorial work that's the right behavior; for code review you may want a structural diff tool instead.

The output renders inline: green for added lines, red for removed lines, gray for unchanged. The summary above counts each category so you can scan the volume of change at a glance.

When to use a text comparison tool

The classic use case is revision tracking. You write a draft, you let it sit, you come back and revise. Pasting the two versions side by side surfaces every word you changed without combing through the document. See also: word replacer. See also: duplicate-line cleanup. See also: character counter. See also: editorial review.

Common scenarios:

  • Contract markup. Compare a counterparty's proposed redline against your original to spot every clause they touched.
  • Editorial review. Compare an editor's pass against your submission to see exactly what they kept, dropped, or rewrote.
  • Translation QA. Compare a re-translation against the original target to verify the meaning didn't drift.
  • AI-rewrite QA. Compare the original draft against an LLM rewrite to see how much the model rewrote vs preserved.
  • Config-file diff. Compare two versions of a YAML, JSON, or .env file to spot the one line that changed.

For binary file compare, source-code merge resolution, or three-way diff, use a dedicated tool such as diff, meld, or your IDE's built-in diff viewer.

Privacy and data handling

The diff runs entirely in your browser. Neither Text A, Text B, nor the diff output ever leaves the page. Nothing is uploaded, logged, or persisted on any server. This matters for the document classes most people compare with these tools: contracts, NDAs, source code, customer data, and pre-publication editorial drafts.

If you need to confirm the privacy guarantee, open your browser's network tab while you type. The tool makes no XHR or fetch calls after the initial page load. You can also save the page to disk and run it offline; everything keeps working.

Comparing this tool against the alternatives

The text-comparison space is dominated by a few names: Diffchecker, text-compare.com, and the diff features built into GitHub, GitLab, Microsoft Word, and Google Docs. Each has its niche.

Diffchecker offers a polished paid product with PDF diff, image diff, folder diff, and saved history. If you compare documents daily and need version-control features, it's worth the subscription.

GitHub / GitLab show diffs as part of pull requests. For code, those are the right tools because they understand syntax, blame, and review threads.

Word and Google Docs compare features track changes within a document. They're useful when both versions are in the same format and you want to merge accepted changes back in.

This page exists for the in-between case: you have two strings of text and you want to see the diff in 10 seconds without an account, an upload, or a desktop install. Paste, see, close the tab.

Frequently asked questions

What is a text comparison tool?

A text comparison tool takes two pieces of text and highlights the differences between them. The diff engine on this page splits each input into lines, finds the longest common subsequence (LCS), and marks every line outside that subsequence as added or removed. The output renders inline with green for added lines, red for removed lines, and gray for unchanged.

How does this differ from Diffchecker?

Diffchecker is a paid product with PDF diff, image diff, folder diff, and saved-history features. This page is a free, single-purpose text-line diff that runs in your browser with no signup. If you only need to compare two strings of text occasionally, this page is enough. If you compare documents daily and want history and image/PDF support, Diffchecker is worth the subscription.

Is the comparison case-sensitive?

Yes, by default. The line "Hello" and the line "hello" are treated as different lines. There is no case-insensitive toggle yet; if you need a case-insensitive compare, lowercase both inputs before pasting.

Can it detect moved blocks?

No. The LCS algorithm finds the longest sequence of matching lines, so a line that gets cut from one place and pasted into another shows up as one delete + one insert, not as a move. This is the same behavior as standard diff and git diff. For move-aware diff, use a structural diff tool.

Does the text leave my browser?

No. The diff runs entirely in JavaScript in your browser. Neither input nor the output is uploaded, logged, or persisted on any server. Verify in your browser network tab: zero requests after the initial page load.

What is the line limit?

There is no hard limit, but the LCS algorithm is O(m×n) in memory, so two 10,000-line inputs (100 million cells) may slow down older devices. For comparisons that large, split into chapters or sections and compare in passes.

What does the line count summary mean?

Added = lines in Text B that are not in Text A. Removed = lines in Text A that are not in Text B. Unchanged = lines that appear in both. The three numbers sum to the total lines in the diff output.

Can I compare more than two texts?

Not at once on this page. For three-way or n-way diff, use a desktop diff tool like Meld or Beyond Compare, or your IDE's built-in merge view.

Related tools

More wordcounter.ai tools

Other tools you might find useful.

Browse the full catalog →