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.

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.

The options above the output change how the diff is computed and shown. Ignore case and Ignore whitespace treat lines that differ only in capitals or in spacing as unchanged. Highlight inside lines marks the exact words or characters that changed in an edited line. Side by side puts Text A and Text B in two columns with line numbers that scroll together, and Only changes hides unchanged lines except two on each side of a change. Swap switches the two texts, Next change jumps through the edits, and Open .txt loads a plain-text file into either box (you can also drop the file on the box).

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.

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 has a free text compare that works without an account, plus PDF, image and folder diff and a paid Pro plan with extra features. If you compare documents daily and need those extras, Pro may be worth paying for.

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 freemium product: its basic text compare is free, and it also offers PDF, image and folder diff plus a paid Pro plan with extra 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 the extra features, Diffchecker Pro may be worth paying for.

Is the comparison case-sensitive?

Yes, by default. The line "Hello" and the line "hello" are treated as different lines. Turn on Ignore case above the diff output to treat them as the same line. Ignore whitespace works the same way for extra spaces, tabs, and leading or trailing spaces.

Can I see the two texts side by side?

Yes. Set View to Side by side above the diff output. Text A shows on the left and Text B on the right, with line numbers, and both columns scroll together. Set Highlight inside lines to Words or Characters to see exactly what changed inside each edited line.

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, including unchanged lines that Only changes hides from view.

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 →