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.
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
Paste JSON to validate and pretty-print it — with error location (line and column) when it's broken, plus key count, depth and size stats. Runs entirely in your browser.
Paste code or a git diff and detect leaked credentials — AWS keys, GitHub and Slack tokens, private key blocks, hardcoded API keys and JWTs. Matched values are masked, never displayed.
Test a regular expression against your text with instant results: all matches, their positions, capture groups and flag support — runs locally, nothing sent anywhere.