Document Comparator
Compares two documents (PDF, Word, or plain text) and highlights the differences between them, word by word or line by line. Text is extracted from each file and compared with the same library used by this site's Text Diff Checker. Everything is processed in your browser, without uploading your files to any server.
How it works
- Select the original document and the modified document (PDF, .docx, or .txt).
- Choose whether to compare by word or by line.
- Click 'Compare documents'; each file's text is extracted (with pdf.js for PDF, mammoth for Word) and compared.
- The result shows the combined text with added content highlighted in green and removed content struck through in red, along with a summary of how many words or lines changed.
Use cases
- Compare two versions of a contract to spot which clauses changed.
- Review the differences between a draft and the final version of a document.
- Check what was modified between two versions of a PDF or Word file received by email.
- Detect changes between two submissions of an assignment or report.
Common mistakes
- Comparing a scanned PDF (an image of each page) expecting its text to be detected.PDF text extraction only works with documents that have a real text layer, not scans. If your PDF is an image, use the PDF OCR tool first to extract the text before comparing.
- Expecting visual formatting (bold, tables, columns) to be preserved in the comparison.The comparison works on the plain text extracted from each document; the original visual formatting isn't preserved or compared, only the text content.
- Using 'By line' mode on documents where text was reflowed into different paragraphs.Line mode compares text line by line exactly as extracted; if a paragraph was split or merged differently between the two documents, it may show more differences than expected. Try 'By word' mode in those cases.
Frequently asked questions
Alternatives
Microsoft Word has a built-in 'Compare Documents' feature that also shows formatting changes, and Adobe Acrobat offers something similar for PDF. This tool is convenient when you don't have those programs installed or want a quick comparison without uploading your files to any service.