Text/Diff Checker

Diff Checker

Line and word level comparison of two inputs

Line-level comparison only.
Text A0 chars
Text B0 chars
Diff0 added · 0 removed

A diff finds the longest common subsequence of two texts and reports what has to be added or removed to turn one into the other. That framing matters: a diff is not a list of what changed in any semantic sense, it is the shortest edit script an algorithm could find, which is why moving a paragraph often shows as a deletion and an unrelated insertion.

Comparing at line level is right for code and configuration, where a line is the meaningful unit. For prose, line-level output is nearly useless — rewrap a paragraph and every line changes — so word-level comparison is what you want. This tool shows both, which is usually the quickest way to see whether a difference is real or cosmetic.

How to use it

  1. Paste both versionsOriginal on the left, changed on the right. The order matters only for which side is labelled as an addition and which as a deletion.
  2. Choose line or word granularityLine level for code and structured data; word level for prose, or for a line that changed in one place and is otherwise identical.
  3. Look for whitespace-only differencesIf two lines look identical but are marked as changed, the difference is invisible: trailing spaces, a tab against spaces, or a different line ending.

Frequently asked questions

Why are two lines that look identical marked as different?

Almost always invisible characters. Trailing whitespace, a tab where the other side has spaces, CRLF against LF line endings, or a non-breaking space pasted from a document. A string inspector will show you exactly which, by listing the code points.

Why does moving a block show as a delete and an add?

Because the classic diff algorithm has no concept of a move — it produces the shortest sequence of insertions and deletions, and a move is exactly that. Some tools detect moves as a post-processing step, but the underlying diff still treats them as two independent edits.

When should I compare by word rather than by line?

Whenever the text is prose. Reflowing a paragraph changes every line without changing a single word, and a line diff reports the whole paragraph as rewritten. Word-level comparison shows the two words that actually changed, which is the information you were looking for.

Is my text uploaded anywhere?

No. The comparison runs in this tab, which is the reason to use an in-browser diff for anything sensitive — a configuration file, a contract, an internal document. Many online diff tools post both sides to a server, and that is worth checking before you paste.

What does the unified diff format mean?

It is the format patch tools and code review use: lines prefixed with a minus were removed, plus were added, and a space means unchanged context. The @@ header gives the line numbers and lengths of the hunk on each side, so a patch can be applied to a file that has shifted.

Related tools

Nothing left this tab. No request was made, no history was written. Text · Diff Checker