Text Diff Checker guide
Paste the original on the left and the new version on the right. The diff updates as you type, marking every added line with + and every removed line with -, the same way git and the Unix diff command do.
Why position-by-position comparison fails
The obvious way to compare two texts is to line them up and check line 1 against line 1, line 2 against line 2, and so on. It breaks the moment someone adds a line. Insert one sentence at the top of a 200-line document and every line below shifts down by one, so a naive checker reports 200 changes when there was really one.
Real diff tools solve this by finding what the two versions have in common first, then reporting only what is left over. This checker does exactly that, which is why its output reads like a git diff instead of a wall of red.
The algorithm: longest common subsequence
A subsequence is a set of lines that appear in the same order in both texts, though not necessarily next to each other. The longest common subsequence, or LCS, is the biggest such set. Those lines are unchanged. Every line in the original that is not in the LCS was removed, and every line in the new text that is not in it was added.
The tool builds a table with one row per original line and one column per new line, fills it with the LCS length for every pair of prefixes, then walks back through it to produce the diff. That takes time and memory proportional to the two line counts multiplied together. Two 4,000-line texts mean 16 million table cells, which is why inputs above roughly 4,000 lines each are capped. Past that, a browser tab starts to stall.
The comparison runs on every keystroke, so you can fix a line in either box and watch the diff update. Both boxes start with sample text so you can see the output format before pasting your own.
Worked example
Original, four lines: apples, bananas, cherries, dates. New version, five lines: apples, blueberries, cherries, dates, elderberries. The longest common subsequence is apples, cherries, dates, three lines.
So the result is: apples unchanged, bananas removed (-), blueberries added (+), cherries and dates unchanged, elderberries added (+). The summary reads 2 added, 1 removed. A position-based checker would have flagged line 2 and then called line 5 new, which happens to match here, but insert a line at the top and it falls apart while LCS does not.
When to use the ignore options
Ignore leading and trailing whitespace is the one you will want most often. Text copied from a PDF, an email, or a different editor often picks up trailing spaces or different indentation. With the option on, a line that differs only in surrounding spaces counts as unchanged. Spaces in the middle of a line still count.
Ignore case helps when one version went through a style pass, such as headings changed to title case, and you only care about wording. Leave it off for code, passwords, and anything where case carries meaning.
Reading the output without getting fooled
This is a line diff. A one-word edit shows up as the whole old line removed and the whole new line added, usually right next to each other. Scan those pairs to find the changed word. Long paragraphs pasted as a single line make this harder, so for prose, break text into one sentence per line before comparing if you want tighter results.
Line endings and invisible characters can cause phantom differences. A line with a non-breaking space or a zero-width character looks identical on screen but will not match. If two lines look the same and still show as changed, clean both sides with the whitespace cleaner and compare again.
Reformatted code is another trap. If one version was run through a formatter, most lines change even though the logic did not. Format both sides the same way first.
Common uses
Editors compare a writer's draft against the published copy. Students check what changed between essay versions. Developers compare config files, environment variables, and SQL snippets without committing anything. Anyone reviewing a contract or policy can see exactly which clauses moved, appeared, or disappeared between two versions.
How we calculate: sources
Frequently asked questions
How do I compare two texts for differences?
Paste the original text in the first box and the changed text in the second. Added lines are marked + and removed lines are marked -, with line numbers and a count of each.
Does it work like git diff?
Yes, for lines. It uses the same longest common subsequence approach as diff and git, so an inserted line does not make every line below it look changed.
Can it ignore whitespace and capitalization?
Yes. Ignore case treats Hello and hello as equal. Ignore leading and trailing whitespace stops indentation or trailing spaces from counting as a change.
Why does an edited line show as removed and added?
The diff works line by line. If one word changes, the old line is marked removed and the new line is marked added. Read the pair together to spot the edit.
Is there a size limit?
Yes. Inputs over roughly 4,000 lines each are capped to keep the page responsive. That covers most documents, articles, and config files.
Can I compare code or JSON?
Yes. Any plain text works. For JSON, format both sides with the same indentation first so the diff shows real changes, not formatting.
Is it safe to compare private documents?
Everything runs in your browser. Nothing you enter is uploaded to a server or stored by us.
What do the + and - symbols mean in a diff?
A + line exists only in the new text (added). A - line exists only in the original (removed). Lines with neither are the same in both.
Does the order of the two boxes matter?
Yes. Put the older version first. Swap them and every addition becomes a removal and vice versa.