Text Diff Checker

Compare two versions of text by line or word. See added, removed, and unchanged content as you edit, with optional whitespace filtering and no text upload.

Loading tool…

How to use Text Diff Checker

  1. Paste the earlier version into Original and the newer version into Revised, or choose Try sample. One empty editor represents an entirely added or removed document.
  2. Choose Lines for whole-line changes or Words for smaller text segments. Results update after a short typing pause. Comparison is case-sensitive in both modes.
  3. Optionally enable Ignore whitespace. In Lines this removes whitespace from each line’s comparison key; in Words it skips whitespace-only tokens. Read the explanation beneath the controls.
  4. Review the Added, Removed, and Unchanged groups and their counts. Swap reverses the comparison. Clear empties both editors while preserving your selected options.

Questions about this tool

How does this text diff checker find changes?

It uses a longest common subsequence to align matching tokens in their original order. The remaining tokens are additions or removals; a replacement therefore appears as both. For example, changing “old” to “new” on a single line produces one removed line and one added line. Repeated text may have several equally valid alignments; this tool prefers a removal when alternatives tie. It does not detect moved blocks or compare meaning.

What is the difference between Lines and Words?

Lines compares whole lines and includes each ending LF line break when present. Words uses the browser’s English Intl.Segmenter word boundaries, retaining punctuation, emoji, and whitespace segments too. Its counts are comparison tokens, not a word count. Word boundaries can vary with browser Unicode data. Use Word Counter when you need writing statistics.

What does Ignore whitespace change?

In Lines, Unicode White_Space characters are removed from each line’s comparison key, including its ending line break. An extra blank line still counts as an added line. In Words, whitespace-only tokens are omitted; it does not join separated words, so “a b” and “ab” can still differ. Unchanged groups show the Revised text, including its spacing. Ignored whitespace is not listed as an edit.

Is the comparison case-sensitive?

Yes. “Hello” and “hello” are different, even when Ignore whitespace is enabled. Accents and other Unicode characters are compared without normalization, so a precomposed accent and a combining sequence can look identical yet differ. The tool does not apply spelling correction, language-aware equality, or source-code semantics.

Are blank lines and the final newline compared?

Yes. Lines includes a final LF in its token, so “hello” and “hello” followed by a line break differ unless Ignore whitespace is enabled. An empty editor has no tokens; a single line break is one blank-line token. Browser text editors normalize CRLF and CR line endings to LF. Unicode line and paragraph separators remain literal characters. This is a text comparison, not a byte-for-byte file comparison.

Why are result tokens surrounded by quotes?

Each token uses JSON string notation so tabs appear as \t and LF line breaks as \n. Literal quotes and backslashes are escaped too. Result content is displayed as text, never interpreted as HTML. The groups are an inspection view: they are not a unified diff, an executable patch, or a reconstructed document. There is no patch export or automatic merge.

How much text can I compare?

Each editor accepts up to 30,000 UTF-16 code units. Each side can retain at most 2,000 comparison tokens, and the alignment table is limited to 1,000,000 cells: (Original tokens + 1) × (Revised tokens + 1). A comparison can exceed the work limit even when both editors are below their text limit. Oversized pastes are rejected whole. Shorten both texts, compare smaller sections, or try Lines mode.

Is my text uploaded or saved?

No. Your text is compared in a browser worker without uploading it or saving it in browser storage. Editing text or options cancels pending work and removes the previous result. Clear or leaving the tool clears its working text. Optional site analytics follow your analytics preference and report only the tool ID and event type, never your input.

Why is a comparison unavailable?

The tool shows an error when a text, token, or comparison-cell limit is exceeded, or if the browser cannot run the worker. A worker that has not finished within ten seconds is stopped. Your editors remain available so you can shorten the text and retry. Words requires English Intl.Segmenter support; Lines can still work without it.

Your Mac, a glance away.

Explore DockMagic’s native Widgets for macOS.

Explore DockMagic