All tools run in your browser — your files never leave your device.
All tools154

Text & Writing

Text Diff Checker

Compare two blocks of text and see exactly which lines changed.

What it does. A diff checker compares two versions of text and marks what changed. This tool shows additions in green and deletions in rose, side by side or inline, at line or word granularity. It uses the Myers diff algorithm — the same one Git uses — and runs entirely in your browser.
Runs in your browserNothing uploadsNo signupWorks offline

How to use Text Diff Checker

  1. Paste the original text into the left box and the revised text into the right.
  2. Switch between side-by-side and inline view, and between line and word granularity.
  3. Read the summary bar for the count of added, removed and unchanged lines.

How does a diff algorithm decide what changed?

A diff does not compare line 1 to line 1 and line 2 to line 2. If it did, inserting a single line at the top would report every subsequent line as changed. Instead it solves for the longest common subsequence — the largest set of lines appearing in both versions in the same order — and reports everything outside that set as an insertion or a deletion.

This implementation uses Myers’ 1986 algorithm, which finds the shortest edit script in O(ND) time where N is the total input size and D is the number of differences. Because D is small for typical edits, it is effectively linear on real documents. Git, Mercurial and SVN all use variants of it.

Word-level diffing runs the same algorithm over tokens instead of lines, which is why a one-word change inside a long paragraph highlights only that word rather than flagging the whole paragraph.

When should I use word diff instead of line diff?

Use line diff for code. Source files have meaningful line boundaries, and a line-level view maps directly onto what you would commit.

Use word diff for prose. A paragraph of text wraps to whatever width the editor uses, so line boundaries are an artifact of the container rather than the content. In a contract or an article, word diff shows you the three words a reviewer actually changed instead of a wall of red and green.

When should I use word diff instead of line diff?
ContentBest granularityWhy
Source codeLineLines are the unit of change and of review
CSV / logsLineOne record per line
Contracts, articlesWordLine breaks are reflow artifacts
Minified JS/CSSWordEverything is on one line
TranslationsWordSmall edits inside long strings

Can I compare two files rather than pasted text?

Yes. Drop a file onto either panel and its contents load into that side. Plain text, source code, CSV, JSON, Markdown, YAML and log files all work, because they are all text under the hood.

Binary files — Word documents, PDFs, images — will not produce a meaningful result. A .docx is a ZIP archive of compressed XML, so diffing two of them compares compressed bytes rather than sentences. Copy the visible text out of the document and paste that instead.

Why does whitespace show as a difference?

Because it usually is one. A tab replaced by four spaces changes the bytes even when the rendering is identical, and in Python or YAML it changes the meaning.

The tool exposes an "ignore whitespace" toggle for the cases where you do not care. With it on, leading and trailing whitespace is stripped and internal runs are collapsed to a single space before comparison. Turn it off when indentation is semantically significant.

A related trap is line endings. Text edited on Windows ends lines with CRLF; text from macOS or Linux uses LF. Paste one of each into the two panels and every line will report as changed. The tool normalizes line endings before diffing to avoid exactly this.

Is this safe for confidential documents?

Yes, and this is the main reason to use it over a server-based comparison service. Diffing is where people paste the most sensitive material they handle: two drafts of an employment contract, a redlined settlement, a patch containing an API key, a redacted and unredacted report.

Every mainstream online diff tool POSTs both documents to a backend. This one does not. The algorithm is a few hundred lines of JavaScript executing in this tab, so both versions stay in your device’s memory and are discarded when you close it.

Frequently asked questions

What do the colors mean?

Green marks content present only in the revised version (an addition). Rose marks content present only in the original (a deletion). Unchanged lines render in the normal text color.

Can it compare two Word documents?

Not directly — .docx is a compressed archive, not text. Open both documents, select all, and paste the visible text into each panel. Word’s own Track Changes is better if you need to compare formatting as well as words.

Does it work for code?

Yes, and line granularity is the right mode for it. The output is equivalent to what git diff would report for the same two file versions.

Is there a size limit?

Both panels handle several megabytes of text. Beyond roughly 50,000 lines the diff computation becomes noticeable, and word-granularity on very large inputs is slower than line-granularity by roughly the average number of words per line.

Can I export the result?

Yes. The copy button produces a unified diff — the same format git diff and patch use — which you can paste into a review comment or apply with the patch command.

Why is a moved paragraph shown as a delete plus an add?

Because that is what a line-based diff computes. Move detection requires a second pass that matches deleted blocks against added blocks, which Git only does with the --color-moved flag. It is a known limitation of the standard algorithm rather than a bug.

Does it detect plagiarism?

No. It compares two documents you supply. Plagiarism detection means comparing one document against a corpus of billions, which requires a server-side index.

Guides for Text Diff Checker