pdftoolskit.org
PDF (Portable Document Format) utilities, in the browser
Say hi →

PDF Text Diff — Compare the Words

line or word diff · unified output · colour-coded

Add two PDFs and see what the text actually says differently. The text layer of each is extracted, aligned with a longest-common-subsequence diff, and reported as added and removed lines — plus a .diff file you can attach to a review.

Drop exactly two PDFs here

First file = original · second = revised

    no files
    Ready.

    Need test files? The sample library has multi-page PDFs you can edit and compare.

    How the comparison works

    Both documents' text layers are read and grouped into visual lines, then the two sequences are aligned with a longest-common-subsequence diff — the same algorithm behind git diff. Unchanged lines are matched up and skipped, so what you see is only the real edits plus the context lines you asked for.

    Word granularity splits every line into words before diffing. That is the right setting when a paragraph was rewritten and a line diff would just show the whole paragraph as removed and re-added; it costs more time on long documents.

    Reading the output

    Its blind spots

    A text diff sees words, not appearance. It will not notice a changed logo, a different font, altered spacing, a moved table, or a new colour — for any of that, use PDF compare, which diffs the rendered pixels. It also cannot read a scan: with no text layer there is nothing to compare, so OCR first.

    Reading order is another caveat. Multi-column pages are read in the order the PDF stores the text, which is usually column by column but occasionally interleaved — the diff then shows differences that are really ordering artefacts.

    FAQ

    Line or word granularity?

    Start with lines: the output is compact and easy to scan. Switch to words when a paragraph was reworded and the line diff shows the whole thing replaced — word mode pinpoints the changed phrases.

    Why does it report differences in identical documents?

    Usually whitespace or reading order. Leave Whitespace: normalise on so runs of spaces collapse. If differences persist, the two files store their text in a different order — common after a re-export from a different tool.

    Can it compare a scan?

    Not directly — a scan has no text layer. Run OCR on it first; note that OCR errors will then show up as differences.

    Is there a size limit?

    The exact diff is quadratic, so very large documents fall back to a straightforward line-by-line comparison automatically (above roughly 4 million line pairs). The result is still useful, just less cleverly aligned.

    Are the files uploaded?

    No. Extraction and diffing both happen in your browser.

    Related tools