Compare Two PDFs

Compare two PDFs and see exactly what changed. The text of each page is lined up word by word, with additions and deletions marked, so you can tell a genuine revision from a reprint. Both files are read here in your browser and neither is uploaded.

  • Nothing uploaded
  • Works with no signal
  • No sign up
  • Reads the text layer
Drop the original PDF here or click to choose one. Long documents take a moment while every page is read.
Drop the revised PDF hereor click to choose it. This is the version you want checked against the original.

Nothing loaded yet.

The text

Load a PDF to see what it contains.

This reads what is actually in the file. A scanned document contains pictures of letters rather than letters, so there is nothing to extract until it has been through optical character recognition.

Your PDF never leaves this device.The file is opened and read by your browser, the text is extracted here in the page, and any download comes from your own machine. Nothing is sent to a server, so nothing is stored on one. Open the network tab in your browser tools and load a document: there is no upload request to see.

1Drop the PDF inIt never leaves your machine.
2Choose how to lay it outEverything updates as you change it.
3The comparisonAssembled here and saved from your own browser.

Reading order rebuilt from the page

A PDF stores runs of text in whatever order they were written, which is often not the order you read them. Every run is placed by its position instead.

How to use this tool

Drop the original PDF on the first box and the revised one underneath. Every page is compared as soon as both are loaded, with additions in green and deletions in red.

Pages that did not change are collapsed to a single line, so a long document with one edit shows you that edit rather than making you hunt for it.

What a text comparison can and cannot tell you

Worth being plain about, because it decides whether this tool answers your question.

This compares the words. If a clause was reworded, a figure changed or a paragraph added, it will show you exactly where. That covers most of what people mean when they ask what changed between two revisions of a document.

It will not see a redrawn detail, a moved dimension line, a different photograph or a change of colour. Two pages can look quite different to the eye and be reported as identical, because none of the text moved. On a drawing set, treat this as a check on the notes and the title block rather than on the drawing itself.

How the words are lined up

The comparison finds the longest sequence of words the two pages share, in order. Everything in that sequence is unchanged. Everything else is either something the original had and the revision does not, or something the revision has and the original did not.

That approach matters because it survives insertions. If a sentence is added in the middle of a paragraph, a naive comparison would report every word after it as changed, since everything shifted along. Lining up the shared sequence instead reports one insertion and leaves the rest alone.

The comparison is done on whole words rather than letters, because a diff that tells you a letter changed inside a word is noise. Punctuation stays attached, so a full stop appearing at the end of a sentence is a real difference and is reported as one.

A worked check you can repeat

Take a page reading the quick brown fox and change it to the quick red fox. The result is one word added, one removed, and three unchanged, rather than the whole line being flagged.

Now add a word in the middle instead. One insertion is reported and nothing after it is disturbed, which is the property that makes the output readable on a real document.

The comparison was checked against an independent implementation before publishing: twenty seven hand written cases covering identical text, single substitutions, pure insertions and deletions, empty documents on either side, documents of different page counts, and inputs too large to align word by word. Then twenty five thousand generated cases, each one a document edited into another by random insertions, deletions and substitutions.

The property those cases test is the one that matters. Taking the unchanged words together with the removed ones must rebuild the original exactly, and the unchanged words together with the added ones must rebuild the revision exactly. If the comparison ever invented a word, lost one or reordered them, that check fails. It did not fail once.

Mistakes that catch people out

Expecting it to compare appearance. Only words are compared. A page can be restyled completely and still read as identical.

Comparing a scan. There is no text in a picture of text. Run it through optical recognition first.

Loading them the wrong way round. The first box is the original. Swapping them turns every addition into a deletion.

Comparing documents whose pages do not correspond. Page three is compared with page three. If a page was inserted early on, everything after it will look changed.

Assuming a password protected file will open. It will not. Remove the protection first, in software that has the password.

Common questions

Are my PDFs uploaded anywhere?

No. Both files are read by your browser and compared here on the page. Neither crosses the network.

What exactly is compared?

The text. Each page of one document is lined up against the same page of the other, word by word, and the differences are marked.

Will it spot a changed image or a moved line?

No. Only text is compared, so a redrawn diagram or a shifted margin will not show up unless the words changed with it.

Why did a scan show no differences?

Because a scan is a picture of text rather than text. There is nothing to compare, and the tool says so rather than reporting a false match.

What if the documents have different page counts?

The extra pages are listed as being in one document only, rather than being quietly ignored.

Does formatting count as a change?

No. Bold, colour and font changes are invisible to a text comparison. Two pages can look quite different and still be reported as identical.

Related PDF tools and reference

Reference: the alignment uses a longest common subsequence, the same idea behind diff.