- How PDF comparison works under the hood (PDF.js + LCS algorithm)
- Step-by-step walkthrough of the Compare PDF tool
- Features: side-by-side view, word diff, change navigation, report export
- Real-world use cases: contract review, academic papers, invoices
- Best practices for accurate text-based comparisons
- Limitations: scanned PDFs, visual layout, non-text content
- 11 frequently asked questions with detailed answers
- Introduction to PDF Comparison
- How PDF Comparison Works
- Step-by-Step Comparison Guide
- Side-by-Side View
- Word-Level Diff
- Change Navigation
- Page Navigation
- Swap Documents
- JSON Report Export
- When to Use PDF Comparison
- Text-Based vs Scanned PDFs
- Best Practices for Accurate Comparisons
- Online vs Desktop Comparison Tools
- Limitations and What to Expect
- Privacy and Security
- What to Do After Comparing
- Key Takeaways
- Related Guides
- About the Author
Introduction to PDF Comparison
Two PDFs that look almost identical -- but somewhere between page 3 and page 12, a sentence changed, a number shifted, or a paragraph disappeared.
Finding that one difference manually is like searching for a typo in a phone book. Your eyes glaze over before you spot it. That is exactly why PDF comparison tools exist. They scan both documents, extract every word, run a proper diff algorithm, and show you exactly what changed -- highlighted in green and red so you cannot miss it.
AFFLIGO Compare PDF tool — a free online PDF comparator — loads both documents locally in your browser, extracts text from every page using PDF.js, runs a word-by-word diff using the Longest Common Subsequence (LCS) algorithm, and renders the results in a synchronized side-by-side view. No server uploads. No sign-ups. Files up to 1GB each are accepted, though very large files depend on your device memory. Just open the page and compare.
Whether you are a lawyer checking contract changes, a student comparing draft revisions, an accountant verifying invoice versions, or just someone who needs to find what changed between two versions of a document, this guide covers everything you need to know about comparing PDFs effectively.
How PDF Comparison Works
Two files, one LCS diff — here is the machinery under the split pane, so a surprising highlight reads as logic, not magic.
Text Extraction with PDF.js
The tool uses PDF.js, a JavaScript library maintained by Mozilla, to parse the raw text content from every page of both PDFs. It reads the embedded text layer directly from the PDF structure, pulling out each word and its position.
Word-by-Word Tokenization
Once text is extracted, it gets broken into individual word tokens. This is more accurate than character-level comparison because it understands word boundaries. The tokenizer normalizes whitespace so minor spacing differences do not create false positives.
LCS Diff Algorithm
The comparison uses the Longest Common Subsequence algorithm -- the same approach used by Git and other professional diff tools. It finds the maximum matching words between documents and flags everything else as added or removed.
Side-by-Side Rendering
Results render in a split view: Document 1 on the left, Document 2 on the right. Added words show in green, removed words in red. Both panes display side by side — scroll each independently, so you always see the same section of both documents.
Professional diff tools like Git use the same Longest Common Subsequence algorithm. By understanding how the comparison works, you can interpret results more accurately -- especially when dealing with documents that have significant reformatting or layout changes that do not affect the actual text content.
I built and tested this comparator on PDF.js + LCS word diff: both files are held in memory together, tokenized word-by-word with whitespace normalized, then rendered in a synchronized split pane (green additions, red removals). Change navigation jumps between contiguous change groups, the swap button reruns the comparison automatically, and the Report button exports a JSON with timestamps, filenames, page counts, and word stats.
Step-by-Step Comparison Guide
Load both versions, run the LCS diff, and walk the changes — three moves to every difference.
Open the Compare PDF Tool
Navigate to affligo.com/compare-documents in your browser. The tool loads instantly with two upload slots side by side: Document 1 (your original or base file) on the left, and Document 2 (the revised or comparison file) on the right. No installation required. Works in Chrome, Firefox, Edge, and Safari.
Upload Both PDFs
Click either upload slot or drag and drop a PDF file onto it. You can upload files in any order -- use the swap button between the slots to switch them if needed. The tool displays the filename and file size for each document so you can confirm you uploaded the right files. Both files are held in memory together for word-by-word LCS diff. Uploading the same file twice is the classic false alarm — as shown in Step 2 above, check both filenames first; identical files report zero differences.
Run the Comparison
Once both files are loaded, the Compare button activates. Click it and the tool begins extracting text from both PDFs. For typical documents this takes a few seconds. Larger documents with many pages may take slightly longer. Everything processes locally in your browser — both files sit in memory together for the word-by-word LCS diff, and nothing is transmitted anywhere.
Review the Differences
The results appear in a side-by-side view. Use the page navigation to move between pages. Use the change navigation buttons to jump directly to the next or previous difference. The stats bar at the top shows total differences, additions, removals, and unchanged words at a glance.
Export the Report
Click the Report button to download a JSON file containing detailed comparison statistics: timestamps, filenames, page counts, and word counts for additions, removals, and unchanged content. This is useful for record-keeping, sharing with colleagues, or tracking changes across multiple comparison sessions.
Side-by-Side View
Both documents display simultaneously in a synchronized split pane layout.
The side-by-side view is the core of the comparison experience. Document 1 appears on the left, Document 2 on the right. As you scroll through either pane, the other stays perfectly aligned. This means you always see the same paragraph, sentence, or line in both documents at the same time.
Words that were added in Document 2 appear with a green background. Words that were removed from Document 1 appear with a red background and strikethrough. Words that appear in both documents are shown without any highlighting, making it easy to scan for changes.
The synchronized scrolling is especially useful for long documents. Instead of manually flipping back and forth between two PDF viewers, you see both versions at the same time and can instantly spot where they diverge.
Word-Level Diff
Differences are highlighted at the word level for maximum precision.
Unlike line-level or paragraph-level comparison tools, AFFLIGO compares at the word level. This means even a single changed word in a 50-page document gets flagged. The word-level approach catches subtle modifications that coarser comparison methods would miss entirely.
For example, if a contract clause says "shall pay within 30 days" in the original and "shall pay within 45 days" in the revised version, a line-level tool might show the entire paragraph as changed. The word-level diff highlights only "30" and "45" -- the actual difference.
The tokenizer normalizes whitespace before comparison, so differences in spacing, indentation, and line breaks do not create false positives. You see only meaningful content changes.
Swap Documents
Switch Document 1 and Document 2 to see the comparison from the other direction.
The swap button sits between the two upload slots and switches their positions. After swapping, what was added becomes removed and vice versa. The comparison reruns automatically with the documents in their new positions.
This is useful when you want to understand changes from a different perspective. For example, if you compared a draft against a final version and want to see what the final version removed (rather than what the draft added), swapping gives you that view instantly.
JSON Report Export
Download a detailed report with comparison statistics for record-keeping.
The Report button generates a JSON file containing comprehensive comparison data: timestamps, filenames, page counts, and word counts for additions, removals, and unchanged content. This is useful for:
Record-Keeping
Save a permanent record of what was compared, when, and the exact statistics. Useful for compliance and audit trails.
Team Sharing
Share comparison results with team members who were not involved in the review. The report provides a concise summary without requiring them to re-run the comparison.
Change Tracking
Compare reports from multiple comparison sessions to track how document differences evolve over time across different versions.
When to Use PDF Comparison
PDF comparison solves real problems across industries and workflows.
Contract Review
Lawyers and business professionals compare contract versions to identify changed clauses, added terms, or removed provisions — a fast first-pass redline review. A single word change in a legal document can completely alter its meaning.
Academic Paper Revision
Students and researchers compare draft versions to see what changed between revisions. Track how arguments evolved, what sections were restructured, and which citations were added or removed.
Invoice Verification
Compare an original invoice against a revised version to spot unauthorized changes to amounts, quantities, or terms. Essential for accounts payable teams processing high volumes of financial documents.
Policy and Compliance
Compare updated policy documents against previous versions to identify exactly what changed. Compliance teams verify that required changes were made and no unauthorized modifications occurred.
Team Collaboration
When multiple people edit a document, comparing versions ensures nothing was accidentally deleted or corrupted. The report export lets you share results with team members remotely.
Version Control
Track document evolution across multiple versions. Compare the latest version against any previous version to understand the complete change history. Especially useful for technical documentation.
Tested while writing this guide: I compared two drafts of a service agreement where the only change was a payment term (Net-30 to Net-15) buried on page 6 — the word-level diff flagged exactly that clause plus two punctuation fixes, ignoring identical pages. A scanned photo-PDF of the same file returned zero comparable text, confirming OCR-first is mandatory for scans.
Text-Based vs Scanned PDFs
The type of PDF you upload determines how well comparison works.
| Feature | Text-Based PDF | Scanned PDF |
|---|---|---|
| Text extraction | Works perfectly | Requires OCR first |
| Word diff accuracy | High -- every word is detected | Low -- no text layer to compare |
| Comparison results | Accurate highlights | May show no differences |
| How to identify | Created from Word, LaTeX, HTML, or digital tools | Created by scanning paper documents or taking photos |
| Fix | No fix needed | Use OCR tool first to add text layer |
If your scanned PDF shows no differences, it is likely because the tool cannot extract text from image-only pages. Use an OCR (Optical Character Recognition) tool first to add a text layer, then compare the OCR output.
Best Practices for Accurate Comparisons
Follow these practices to get the most accurate and useful comparison results.
Use Text-Based PDFs
The comparison tool works by extracting embedded text. Text-based PDFs (created from Word, LaTeX, or HTML) produce the best results. Scanned image-only PDFs may not yield usable text without OCR preprocessing.
Name Files Clearly
Before comparing, ensure your files have clear names that indicate their version. "Contract_v1.pdf" and "Contract_v2.pdf" are much easier to track than "document (1).pdf". The comparison report includes filenames, so clear naming makes the report immediately useful.
Check Page Counts
If one document has significantly more pages than the other, the extra pages will show as entirely added or removed. This is expected behavior. For documents with different page counts, pay attention to where content diverges.
Focus on Content, Not Formatting
The tool compares text content, not visual formatting. If a paragraph was reformatted but the words stayed the same, it will not show as a difference. This is usually what you want -- you care about content changes, not cosmetic adjustments.
Export Reports for Record-Keeping
Always download the comparison report after reviewing results. The JSON report provides a permanent record of what was compared, when, and the exact statistics. This is invaluable for compliance and audit trails.
Online vs Desktop Comparison Tools
How browser-based PDF comparison compares to desktop software.
| Feature | AFFLIGO (Online) | Adobe Acrobat (Desktop) |
|---|---|---|
| Price | Free | Paid subscription |
| Installation | None -- runs in browser | Desktop app required |
| Privacy | 100% client-side, local only | Files processed locally |
| Diff granularity | Word-level | Word-level |
| Report export | JSON statistics | PDF comparison report |
| Works on | Any device with a browser | Desktop only |
| Batch comparison | Two files at a time | Multiple files |
| Scanned PDF support | Requires OCR first | Built-in OCR |
AFFLIGO is best for quick, private, free comparisons where you do not need to install software or pay for a subscription. Adobe Acrobat offers more features for enterprise workflows but requires a paid plan.
Two more names you will meet: Draftable compares documents online but uploads your files to its servers with free-tier usage caps, and Bluebeam is built for visual overlay comparison of drawings (AEC markups) rather than word-level text diff — pick it for plans, AFFLIGO for wording.
Sources: PDF.js docs, Adobe Acrobat Compare feature page and pricing checked Aug 2026.
Limitations and What to Expect
Every comparator has blind spots — here is exactly where this one stops seeing, so you never mistake silence for agreement.
Scanned PDFs
Image-only PDFs without embedded text will show no differences because the tool cannot extract text from images. Use an OCR tool first to add a text layer before comparing scanned documents.
Visual Layout Changes
The tool compares text content, not visual positioning. If text was moved to a different location on the page but the words stayed the same, it will not register as a change.
Non-Text Content
Images, charts, tables with embedded graphics, and vector drawings are not compared. The tool focuses on text content only. Embedded images will not show differences even if they changed between versions.
Reordered Paragraphs
If whole paragraphs moved position but the words stayed the same, LCS matching may flag large blocks as removed-then-added rather than moved. Read the surrounding context — identical wording in both panes means content moved, not changed.
This tool is designed for text-based PDF comparison. For scanned documents, always run OCR first. For visual layout comparison, consider using specialized tools like Adobe Acrobat visual diff feature. It is not a plagiarism checker either — it diffs two documents you supply, with no web or database search.
Privacy and Security
Contracts, not servers: why comparing inside the tab matters.
AFFLIGO Compare PDF is 100% client-side. When you upload a PDF, the file is read directly by your browser using JavaScript. Text extraction happens locally using PDF.js. The diff algorithm runs entirely in your browser memory. At no point is your document data sent to any server.
This means:
No Server Uploads
Your PDF files are never transmitted over the internet. They stay on your local device from upload to comparison to results.
No Account Required
No sign-up, no login, no email address. Open the page and start comparing immediately.
No Data Storage
Once you close the browser tab, all comparison data is gone. Nothing is stored on any server. There is no database of compared documents.
What to Do After Comparing
Once you have identified the differences, take the next step in your document workflow.
After you have identified and reviewed all the differences, you might need to merge specific pages, extract changed sections, protect the final version with a password, add a watermark to indicate review status, or compress the document for email sharing.
Frequently Asked Questions
How does PDF comparison work?
Is my data private when comparing PDFs?
How is the side-by-side view different from other tools?
What is change navigation?
What do the green and red highlights mean?
How is this different from desktop PDF comparison tools?
Can I use this for contract review?
What algorithm does the tool use?
Does the tool detect formatting changes?
Can I compare PDFs on my phone?
Can I compare two PDF files for differences and highlight the changes?
Key Takeaways
- AFFLIGO Compare PDF extracts text using PDF.js and compares documents word-by-word using the LCS algorithm.
- The side-by-side view with synchronized scrolling makes it easy to see exactly what changed between two versions.
- Word-level diff catches subtle changes like single-word replacements that line-level tools would miss.
- Change navigation lets you jump directly between differences without scrolling through the entire document.
- Export the JSON change report for audits — it stamps filenames, page counts, and word stats onto every comparison.