CalcHub

Text Diff Checker — Compare Two Texts Line by Line

Paste two versions of a text or file and get a line-by-line diff: added, removed and unchanged lines, unified-diff style. Runs locally — paste production configs safely.

Waiting
Paste content above
The tool runs instantly, entirely in your browser.

Last reviewed 2026-10-19. Rates change — verify against the official sources linked below before relying on these figures.

What this is based on

  • Line-based LCS diff — the same algorithm family as git diff. + = added, − = removed.
  • Capped at 1,500 lines per side to keep the browser responsive.
  • Everything runs locally in your browser — pasted content is never uploaded, logged or stored.

Reading a unified diff

Lines prefixed with − exist only in the original; lines with + exist only in the new version; unprefixed lines are unchanged context. The output format here mirrors git's unified diff — paste the result into any diff-aware tool and it will understand it.

Line-based diffing is exactly what git does — it tracks content by lines, not characters. That's why reformatting a file (changing indentation) produces a massive diff even when nothing semantically changed.

When diffs lie

Two classic traps: whitespace normalization (trailing spaces, tabs vs spaces produce phantom changes) and line-ending differences (CRLF vs LF — the whole file looks changed). If a diff looks impossibly large, normalize whitespace and line endings first, then diff again.

Frequently asked questions

How do I compare two files for differences?
Paste each file's contents into the two boxes above. For whole files locally: diff a.txt b.txt (Linux/macOS) or fc a.txt b.txt (Windows).
What does + and − mean in a diff?
+ lines exist only in the new version; − lines only in the original; unprefixed lines are unchanged context.
Can it diff JSON or code?
Yes — it's content-agnostic, comparing lines of text. For semantic JSON comparison (ignoring key order), pretty-print both sides with the JSON formatter first.
Is my code uploaded anywhere?
No — the LCS algorithm runs in your browser. Check DevTools → Network; nothing is sent.

Related calculators