Text Diff Checker

Paste the original and changed versions of a text and get a line-by-line diff: removed lines in red, added lines in green — computed locally, like git does it.

text-diff · runs locally

How this text comparison works

The checker splits both texts into lines and finds their longest common subsequence — the biggest run of lines the two versions share in order. Lines outside that backbone are the actual changes: present only in the original means removed (, red), present only in the changed text means added (+, green). This is the same principle behind git diff and the classic Unix diff tool, so the output reads like a patch you have seen a hundred times. The comparison runs entirely in your browser; nothing you paste is uploaded.

How to compare two texts

  1. Paste the original version on the left and the edited version on the right.
  2. Click Compare and scan the red/green lines and the added/removed counts.
  3. For prose, put one sentence per line first — reflowed paragraphs otherwise mark every line as changed.

Getting cleaner diffs

Diff noise almost always comes from formatting, not content. Watch for trailing whitespace and mixed line endings (a Windows \r\n file against a Unix \n file differs on every line), and normalize indentation before comparing code. A line edited in place appears as a remove-plus-add pair — that is standard diff behavior, not two separate changes. If you are comparing JSON, the JSON Diff tool understands structure and ignores key order and formatting entirely, which is usually what you actually want for API payloads.

Frequently asked questions

How does this diff checker work?

It computes the longest common subsequence (LCS) of the two texts' lines — the largest set of lines that appear in both, in the same order. Everything outside that subsequence is reported as removed (only in the original) or added (only in the changed version). Git's default diff algorithm is built on the same idea.

Does it compare whole lines or individual words?

Whole lines: a line counts as changed if even one character differs, and it shows up as a removal plus an addition. Line-level diffs are the standard for code and config files because they map directly to how patches apply. For prose, breaking the text into one sentence per line first gives a much more readable diff.

Can it handle large files?

Each side is capped at 2,000 lines, which keeps the O(n×m) comparison instant in the browser — that covers the vast majority of config files, code files and documents. For bigger inputs, compare them in chunks, or use a local tool like git diff or diff on the command line.

Is the text I paste uploaded anywhere?

No. The diff is computed entirely by JavaScript running in your browser tab; there is no server-side processing, logging or storage. That makes it safe for comparing private drafts, contracts or configuration — though as with any online tool, your own machine and browser extensions remain the trust boundary.