BASALT · JOURNAL

How to compare two PDFs and see exactly what changed

2026-08-06 · compare two pdfs for differences

Someone sends back a revised agreement as a flat PDF with no tracked changes. You need to know what moved, and reading both documents side by side is not a plan. The hard part is that most PDF comparison tools answer a different question.

Two ways to compare, and only one is useful

A comparison tool can look at two things: the rendered appearance of each page, or the text those pages contain.

Rendered comparison rasterizes both documents and diffs the pixels. It is easy to implement and produces a striking result: two page images with differing regions highlighted. It also reports a difference whenever anything shifts. Substitute a font and every glyph moves by a fraction of a point, so the tool says every page changed. That answer is correct and useless.

Text comparison extracts the words and diffs the sequences. It is indifferent to font substitution, kerning, anti-aliasing, page size, and margins. If a clause changed from thirty days to sixty days, that is what it reports, whether or not the paragraph reflowed onto a new page.

The distinction matters because the question people actually have is what this redraft says that the old one did not. That is a question about words. Layout comparison answers whether the file renders identically, a bad proxy for meaning.

Why extracting text from a PDF is not trivial

PDF has no concept of a paragraph, a sentence, or even a word. A page's content stream contains text-showing operators such as Tj and TJ that draw glyph codes at positions set by the text matrix. Reading order is not stored anywhere; a comparison engine reconstructs it.

Glyph codes map to characters only through the font's encoding and, for embedded subset fonts, through a ToUnicode CMap; when that map is missing or wrong, extraction produces garbage that looks like text. Word boundaries often exist only as horizontal displacement, so the extractor infers a space from the gap between glyph positions. Multi-column layouts, tables, and footnotes interleave in whatever order the producer emitted them.

None of this is exotic. It is why two tools extracting from one page can produce different text, and why a comparison is only as good as the extraction underneath it.

What a blackline is and why the format matters

The traditional legal presentation is a blackline: removed text struck through, added text underlined, in the flow of the document. It has been the convention for decades because it puts each change in context, and readers already know how to read it.

The alternatives are worse for review. A two-column side by side view makes the reader do the alignment. A list of changes without context sends them back into the document.

Grouping the blackline by page matters more than it sounds. It gives every change a location you can cite, and it makes the output skimmable: a page with no entries had no changes.

What a comparison should tell you before you read it

Counts: how many lines were added, how many removed, and how many pages were compared.

Those three numbers let you sanity check the comparison before trusting its detail. If you expected two clause edits and the tool reports 900 lines added and 900 removed, either the extraction failed or you compared the wrong files. Zero changes on a document you know was revised deserves the same suspicion.

Exporting the result as a text file matters for the same reason a blackline does: it goes in an email or a matter file without anyone needing your software.

What text comparison will not tell you

The limits are real, so be clear about them.

Text comparison does not detect formatting. Bold to regular, a font swap, a color change, or a shift in margins produces identical text and reports nothing. It misses changes inside images too: a revised chart embedded as a picture has no extractable text, and on scans you need OCR first, after which you are comparing OCR output with its own errors.

It also says nothing about the parts of the file a reader never sees: metadata, embedded files, annotations, or content hidden behind optional content groups, covered in what is hiding in your PDFs.

And it does not know intent. A moved paragraph appears as a deletion in one place and an addition in another, which is accurate and occasionally not what you wanted.

Practical use

Compare the versions you actually exchanged, not your working copies. Watch for a document printed and re-scanned somewhere in its history: it has no text layer, only an image of one, so comparing it to a born-digital original compares nothing to something. A comparison also tells you nothing about what a file carries beyond its page text, which is the province of redaction verification.

Frequently asked questions

How do I compare two PDFs for differences?

Use a tool that extracts and compares the text of both documents rather than diffing rendered page images, then presents the result as a blackline with removals struck through and additions underlined. Pixel comparison reports a difference whenever anything shifts, including a font substitution that moves every glyph by a hairline.

Can Preview compare two PDFs?

No. Preview can display two documents at once but has no comparison feature, no text diffing, and no way to produce a blackline. macOS ships nothing else that does it: Automator's PDF actions handle assembly and rendering rather than analysis, so comparison needs a dedicated application.

Why does my PDF comparison show every page as changed?

Because it is comparing rendered appearance rather than text. A font substitution, a different PDF producer, or a slightly different page box moves every glyph by a fraction of a point, and a pixel diff correctly reports all of it as different. Comparing extracted text ignores those shifts and reports only the words that changed.

What is a blackline?

A blackline is a comparison presented in the flow of the document with removed text struck through and added text underlined, so each change appears in its original context. It is the traditional legal format for showing what a redraft altered, and it is easier to review than a side by side view.

Can I compare a scanned PDF to a digital one?

Only after running OCR on the scan, because a scanned page contains an image with no extractable text, so a text comparison has nothing to read on that side. Once OCR has produced a text layer you can compare, but the result includes any recognition errors as apparent changes. Expect noise.

Will a comparison catch formatting changes?

No, if it compares text. A change from bold to regular, a font swap, a color change, or a different margin produces exactly the same extracted words and shows up as no difference. That is a deliberate tradeoff: ignoring presentation is what stops a text comparison from flagging every page when a font shifts.

Does comparing two PDFs modify the files?

It should not. A comparison is a read operation, and a well-built tool opens both documents, extracts their text, and writes only its report. Be careful with tools that re-save or normalize a document as part of the process, since any rewrite changes bytes and may alter what a later check sees.

Can I compare more than two PDFs at once?

Comparison is inherently pairwise, so comparing three versions means running two comparisons: one against two, then two against three. Chaining them shows how a document evolved through each round rather than collapsing everything into one diff. Saving the sequence as a repeatable procedure keeps the pairings consistent, as in running the same PDF steps repeatedly.

Doing it in Basalt

Basalt's COMPARE tool compares the text of two documents, not the layout, which is deliberate: layout comparison flags every page whenever a font shifts by a hairline. It produces a blackline in the traditional form, struck through for removals and underlined for additions, grouped by page, reporting how many lines were added and removed across how many pages, exportable as a text file. Everything runs inside a sealed engine process with no network entitlement, enforced by macOS at the code-signature level, so neither draft leaves your Mac. Compare is one of 18 tools in one window, $29 once for three Macs, free for 24 hours, at basaltformac.com.

Redaction that proves itself

Basalt destroys the content you mark, then re-opens the file it wrote and proves the content is gone before it saves anything. Your documents never leave your Mac.

DOWNLOAD BASALT 2.3.0 BUY $29 FREE FOR 24 HOURS · MACOS 13+