Compare PDF
Visual + text diff of two PDFs, page by page.
How to use Compare PDF
What this tool does
Compare PDF takes two PDFs — call them A (the baseline) and B (the revision) — and produces a per-page report:
- A visual diff image for each page, where pixels that differ between A and B are highlighted in opaque red over a faded grey base. You see exactly where the pages differ at a glance.
- A text-line count for each page in A and in B, plus a flag marking whether the two pages have any text-content difference.
- Optionally a side-by-side view: A and B rendered next to each other at matching scale, useful for reading the actual content rather than just the highlights.
Two views, two side-channels, one report.
Why both pixel diff and text-line counts
PDFs lie about being “the same document” in two ways:
- Two PDFs may have identical text but render differently — different fonts, different kerning tables, different anti-aliasing produce subtly different pixels. A pixel-only diff would call them “different” even though no reader could tell.
- Two PDFs may render identically on screen yet have different
text layers (a PDF made by re-encoding via OCR vs. one with a
native text layer; or one with
Boldas a font weight vs. the same letters drawn as paths).
By exposing both, the tool gives you enough signal to tell which case you’re in. If pixels differ but the text-line counts and content match, you’re probably looking at a font or re-rendering difference. If the line counts differ, you’re looking at a real edit.
How the visual diff works
For each page in min(len(A), len(B)):
- Both A’s page and B’s page are rendered to canvases at the same dimensions using pdf.js.
- The two pixel buffers are walked in lock-step. For each pixel
position, the algorithm computes
delta = |Ar − Br| + |Ag − Bg| + |Ab − Bb|. - If
delta > 24, the output buffer marks that pixel as “changed” and paints it opaque red. Otherwise the pixel is painted as a faded grey version of A. - The resulting image is the visual-diff for that page.
The threshold of 24 (out of a possible 765 per pixel) is the sweet spot between catching real edits and ignoring sub-pixel font-rendering noise. It’s a fixed value, not a user setting, because the right answer is empirically narrow.
If A has more pages than B (or vice versa), the extra pages are listed as “added” or “removed” in the report rather than diffed.
Common use cases
- Contract review for redlines. Your counterparty sent back v2 of a contract; visual-diff shows you every changed clause, every moved paragraph, and every revised number without you scrolling back and forth between two windows. Combine with the text-line-count side channel to confirm the structural changes.
- Regulatory document tracking. When a regulator publishes a revised guidance document, comparing it against the prior version reveals exactly what changed — often more reliably than the official “summary of changes” page.
- Design proof checking. Before signing off on print artwork, diff the latest proof against the approved version. Catches accidental edits, missing brand marks, and silent asset swaps.
- Academic paper revision comparison. Reviewing your own changes between draft 4 and draft 5, or comparing your submitted version against the proof returned by the journal.
- Documentation audits. Compare last year’s policy PDF against this year’s revision to spot every clause that changed.
How to use this Compare PDF tool
- Drop PDF A (the baseline) onto the left dropzone.
- Drop PDF B (the revision) onto the right dropzone.
- Pick a diff mode:
- Overlay — red highlights over a faded grey base, page by page. Best for spotting changes.
- Side-by-side — A and B rendered next to each other at matching scale. Best for reading content.
- Click Compare. The tool renders each pair of pages, computes the visual diff and text counts, and produces the report.
- Scroll through the per-page report. Pages where nothing changed show clean grey; pages with edits show red highlights plus a non-zero changed-pixel count and a text-content flag.
- Pages that exist in only one of the two PDFs are listed at the bottom of the report as added or removed.
Security and limits considerations
- No in-place edits. The tool does not modify A or B. It produces a comparison report; if you want to merge or reconcile differences, that’s a separate workflow.
- No “accept change” flow. Unlike Word’s track-changes, you cannot click on a red region and accept or reject the edit. The output is comparison, not authoring.
- Pixel diff is the source of truth for the visual report. Identical text rendered through different fonts will diff red. That’s correct behaviour — the pages look different to a reader, even if the words are the same — but it’s worth expecting.
- Scanned (image-only) PDFs are still comparable visually but the text-line side-channel will be empty (no extractable text layer). Run OCR first if text-based diff matters.
Privacy
Both PDFs are loaded into this browser tab via the File API, rendered locally with pdf.js, and diffed in JavaScript on your CPU. The diff report is rendered on local canvases. No file or report leaves your device. The only network requests this page makes are for its initial JavaScript bundle. After load, you can disconnect from the network and the comparison still works.
Compatibility notes
The visual-diff report is rendered to in-page canvases — every
modern browser supports it (Chrome, Edge, Firefox, Safari since
2020). Saving an individual diff page as PNG works in any
browser that supports canvas.toBlob. Large documents (200+
pages) take longer to render and diff; for batch regulatory
comparisons, leave it running in a background tab.
Frequently asked questions
Can I compare PDFs of different page sizes?
What's the sensitivity threshold?
Why does my diff show red highlights even though the text is identical?
Does this do semantic diff like Word's track-changes?
Are my two PDFs being uploaded for comparison?
Related tools
PDF Text Extractor
Pull the plain text content out of a PDF.
PDF to TXT
Extract a PDF's text and download it as a .txt file.
PDF Merger
Combine multiple PDF files into one document.
PDF Splitter
Split a PDF into separate files or page ranges.
Text Diff Checker
Compare two texts and highlight every difference.
JSON Diff Viewer
Compare two JSON documents side by side.