PDF Compare
Compare two PDFs line by line and see exactly which text was added or removed — entirely in your browser.
Quick answer: Drop two PDFs (A and B). We extract text from each with pdf.js, normalise whitespace and run a Myers-style line diff, then show added / removed / unchanged lines side-by-side and let you download the diff as a .diff.txt patch.
Last updated
Frequently asked questions
- Does it compare visual layout or text?
- Text. PDF Compare extracts the text layer of each PDF and diffs lines. Two visually different layouts that contain the same words will show as identical; two layouts with the same look but different fonts will too — only the text is compared.
- Can it compare scanned PDFs?
- Not directly — scans have no text layer. Run each through PDF OCR first, then drop the OCR'd PDFs into the comparator.
- What's added vs. removed?
- Added (green +) means present in B but not in A. Removed (red −) means present in A but not in B. The convention is 'A is the original, B is the new version' — same as `diff old new`.
- Are my PDFs uploaded?
- No — text extraction with pdf.js and the diff algorithm both run in your browser. Open DevTools → Network and you'll see nothing.
- How big a PDF can it compare?
- Comfortably up to a few thousand lines per side. We use a true Myers/LCS diff for accuracy up to ~4,000 lines per side; beyond that, we fall back to a fast set-based diff that still flags additions and removals but no longer pairs them with surrounding context.
- Why are some lines shown as both added and removed?
- When a single line changes by even one character, the diff treats it as 'old line removed' + 'new line added'. That's how all line-level diffs work — it's not a bug. For finer character-level diffs, paste the lines into our Text Diff Checker.
- Can I download the result?
- Yes — click 'Download .diff.txt' to get a unified-style patch (with `+` and `−` prefixes) you can paste into a code review or share with reviewers.
- Will it ignore page breaks?
- Page boundaries are inserted as a marker line ('──── Page 2 ────'). They're treated as text — usually they line up between A and B and don't pollute the diff.
- Is the order of A and B important?
- Yes. By convention drop the original into A and the revised version into B, so 'added' lines mean what got added in the revision.
- Does it ignore whitespace differences?
- Yes — runs of spaces and tabs are collapsed to single spaces and trimmed, so a line with extra padding doesn't register as different.