ToolJutsu
All tools
PDF Tools

Compare PDF

Visual + text diff of two PDFs, page by page.

Original PDF (A)
Modified PDF (B)
Processed on your device. We never see your files.

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 Bold as 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)):

  1. Both A’s page and B’s page are rendered to canvases at the same dimensions using pdf.js.
  2. The two pixel buffers are walked in lock-step. For each pixel position, the algorithm computes delta = |Ar − Br| + |Ag − Bg| + |Ab − Bb|.
  3. 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.
  4. 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

  1. Drop PDF A (the baseline) onto the left dropzone.
  2. Drop PDF B (the revision) onto the right dropzone.
  3. 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.
  4. Click Compare. The tool renders each pair of pages, computes the visual diff and text counts, and produces the report.
  5. 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.
  6. 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?
Yes — the tool normalises each pair of pages to the same render dimensions before running the per-pixel diff. The 'A' page and the 'B' page are both rendered at the same canvas size, so a US Letter version of a document compared against an A4 version will diff correctly (with the expected red highlight at the margins, since those bytes really are different).
What's the sensitivity threshold?
A pixel is considered 'changed' if the sum of absolute differences in R, G, and B between the two rendered pages exceeds 24 (out of 765 maximum). This catches real visual differences while ignoring sub-pixel anti-aliasing noise and minor font-rendering quirks. The threshold isn't currently user-adjustable; 24 was tuned empirically to produce clean output on the common cases (contract redlines, design proof revisions) without false positives on identical files that happened to render through different decoders.
Why does my diff show red highlights even though the text is identical?
Visual diff is per-pixel. If the two PDFs render the same text using different fonts, different font sizes, different kerning, or different anti-aliasing — they look 'the same' to a human but produce different pixels at sub-letter scale. The tool flags every pixel that differs above threshold; that includes legitimate visual differences a reader would shrug at. For a content-only comparison, look at the text-line counts and 'changed' flags in the per-page summary, which use the extracted text layer instead of pixels.
Does this do semantic diff like Word's track-changes?
No, and the distinction matters. Word-style track-changes operate on the document model — it knows 'this paragraph was inserted', 'this sentence was deleted'. PDFs have no equivalent universal change model; once flattened to PDF, the document is a static rendering. This tool does two things instead: a per-pixel visual diff (catches anything that changed how the page looks) and a per-page text-line count + changed flag (catches whether the text content differs at all). For true semantic redline tracking, work in the source format (Word, Google Docs, LaTeX) before flattening to PDF.
Are my two PDFs being uploaded for comparison?
No. Both files are opened by pdf.js in this browser tab, rendered to canvases locally, diffed pixel-by-pixel locally, and the highlighted result is built locally. Neither file leaves your device. The only network requests this page makes are for its initial JavaScript bundle; once loaded, the comparison works offline. This matters when you're reviewing confidential contracts, regulatory filings, or unreleased designs.

Related tools