Converter tool

Compare Word Documents

Pick two versions of a Word file and see removed words struck through in red and added words underlined in green, paragraph by paragraph. Both files are read in your browser.

Drop a .docx file here or choose one.

Drop a .docx file here or choose one.

Only the visible body text is compared. Tracked changes and comments inside the files are not read as changes: pending insertions count as normal text, pending deletions are skipped, and comments, headers, footers, images and formatting are ignored.

Comparison options

Preview

Output Preview

Choose the original and the revised .docx, then press Compare to see the changed words here.

Compare Word Documents

Operator: Abdulla Al Fahad. How tools are built and checked

Two copies of a Word file named final.docx and final-v2.docx, and nobody turned on Track Changes. Reading them side by side by eye is how a changed delivery date slips through. This page takes both .docx files, pulls out the words of every paragraph, and lines the two versions up so that each word that disappeared is struck through in red and each word that appeared is underlined in green.

The comparison is about wording. Bold, fonts, page breaks, pictures and the comment balloons in the margin are not part of what is read, and pending tracked changes are not reported as changes (more on that below). If the question is "did any sentence in this document say something different?", it gives a direct answer; if the question is "does the document look the same?", it does not.

Key features

  • Two separate drop zones for the original (A) and the revised (B) .docx.
  • Paragraph-level alignment followed by word-level highlighting inside edited paragraphs.
  • Counts of added words, removed words, changed paragraphs (split into edited, added and removed) and unchanged paragraphs.
  • Side-by-side and inline views, plus a filter that hides unchanged paragraphs.
  • Options to ignore letter case and spacing differences.
  • A self-contained HTML report with escaped text that opens in any browser.
  • Specific messages for old .doc files, password-protected files, files over 25 MB and documents with no body text.

Turning each .docx into lines to compare

A .docx file is a ZIP archive. The text lives in one part of it, word/document.xml, as paragraphs made of runs, where a new run starts whenever the formatting changes, even in the middle of a word. The mammoth library, running in this page, walks that XML and joins the runs back into plain paragraphs, so a word split across a bold and a normal run still reads as one word.

Each paragraph becomes one line. List items and table cells are paragraphs in Word's model, so each cell or bullet is its own line too, and empty paragraphs used as spacing are dropped so that adding a blank line between two sections is not reported as a change.

The two lists of paragraphs then go through the same diff engine as the site's Text Compare tool: first a paragraph-level pass to find which paragraphs were inserted or deleted, then a word-level pass inside each pair of paragraphs that are similar enough to be the same paragraph edited.

How it works

Each slot accepts a Word file only if it is a genuine .docx, which is a ZIP package and so opens with the letters PK. Files saved in the older .doc format, and Word files locked with a password, use a different container; the tool turns them away and explains how to save a plain .docx copy from Word. Anything over 25 MB is declined before mammoth reads it.

mammoth extracts the raw text, which is trimmed and split into paragraphs. When both files are ready, pressing Compare runs the diff and builds the table. The report download is created from the same result, so what you save matches what you see.

Common use cases

  • A freelancer gets a services agreement back from a client with the note "a few tweaks" and wants to see exactly which terms moved before signing.
  • A thesis supervisor receives chapter 3 again and wants to read only what the student rewrote since the last round of feedback.
  • A policy owner checks that the HR handbook published on the intranet matches the version legal approved.
  • A translator confirms which paragraphs of a source document changed between two deliveries, so only those need retranslating.
  • A grant writer compares the submitted application with the draft a co-author kept editing afterwards.

How to use this tool

  1. Drop or choose the original .docx in the Original document (A) box.
  2. Drop or choose the revised .docx in the Revised document (B) box and check the paragraph and word counts under each name.
  3. Tick any options you need, such as Ignore letter case.
  4. Press Compare.
  5. Read the four counts, then scan the highlighted rows in Side by side or Inline view.
  6. Press Download HTML report to keep a copy.

Example

Two versions of a services agreement: four paragraphs in A, five in B

A:
Services Agreement
The Designer will deliver three logo concepts by 1 March.
Payment is due within 30 days of invoice.
Either party may end this agreement with written notice.

B:
Services Agreement
The Designer will deliver two logo concepts by 15 March.
Payment is due within 14 days of invoice.
Late payments accrue interest at 2% per month.
Either party may end this agreement with written notice.

Result

Added words 11, removed words 3, changed paragraphs 3 (2 edited, 1 added, 0 removed), unchanged paragraphs 2.
Paragraph 2: deliver [three → two] logo concepts by [1 → 15] March.
Paragraph 3: due within [30 → 14] days of invoice.
New paragraph 4: Late payments accrue interest at 2% per month. (all 8 words counted as added)

Tips for best results

  • Put the older file in slot A and the newer one in slot B. Red then means "was in the old version only" and green means "new in this version".
  • Tick Show changed paragraphs only on a long contract to hide everything that matches; the counts stay the same.
  • Use Ignore spacing differences when one copy went through a template that turned double spaces into single spaces or changed tabs to spaces.
  • Switch to the Inline view on a phone: it shows each edited paragraph once with the old word immediately before the new word.
  • The paragraph counts under each file name are a quick sanity check. If B has far fewer paragraphs than A, a section may have been deleted, or B may hold its text in text boxes that are not read.

Common pitfalls

Pending tracked changes are invisible to this comparison. If B still has unaccepted revisions, inserted text is read as if it had been accepted and deleted text is read as if it were gone. That means a sentence someone proposed to delete will look already deleted. Accept or reject all changes in Word first if you need to compare a settled version.

Comments are not read at all, so two files that differ only in their margin comments compare as identical.

Text in headers, footers, footnotes, endnotes and floating text boxes is outside the main body that mammoth reads. A changed company address in a letterhead footer, or a changed footnote citation, will not appear.

Moving a paragraph is shown as a removal in one place and an addition in another, because the diff keeps document order. The word counts then include that paragraph twice, once as removed words and once as added words.

Automatic numbering is not text. If clause 4.2 became clause 4.3 because a clause was inserted above it, only the inserted clause is reported, not the renumbering. Typed numbers, by contrast, are text and do show up.

Common errors and how to fix them

The file is refused as an older .doc or password-protected Word file.
Open it in Word, remove the password under File > Info > Protect Document if there is one, then use Save As and choose Word Document (.docx).
The file is refused because it does not start with the ZIP header.
It is not a real .docx, even if the name ends in .docx. It may be an RTF or HTML file renamed by an email system. Open it in Word and save it again as .docx.
The file opened but has no text to compare.
The content is probably a scanned image pasted into Word, or it sits entirely in text boxes or shapes. Copy the text into the page body, or use the Text Compare tool with pasted text.
A file over 25 MB is refused.
Large Word files are nearly always large because of embedded images. Save a copy, delete or compress the pictures, and compare the copy; the text is unchanged.
The result shows a change you cannot see in Word.
Look for a different apostrophe (straight ' versus curly ’), a hyphen that became a dash, or a doubled space. Ticking Ignore spacing differences removes the spacing cases; apostrophe, quote and dash styles still count as different characters.

Best practices

  • Accept or reject all tracked changes in both copies before comparing when the goal is to confirm the final wording.
  • Compare the exact file that will be signed or submitted, not an earlier export of it.
  • After a clean result, still open both files once to check tables of figures, footers and images, which the comparison does not read.
  • Keep the HTML report alongside the signed copy as a record of what you reviewed.

Why tracked changes are read as accepted

In the XML of a .docx, a tracked insertion is ordinary text wrapped in an insertion marker, and a tracked deletion is text moved into a separate deleted-text element. mammoth follows the inserted text as normal content and does not read the deleted-text element, which is the same thing Word shows when you choose the No Markup view. So each file is compared as it would read if every pending change were accepted.

This matters most when someone sends a file with revisions still open. If you want the comparison to show their proposals, accept all changes in B and leave A as it was. If you want to see what the document said before their proposals, reject all changes in B instead.

How the word and paragraph counts are worked out

A word is any run of letters or digits, so "2%" counts as one word (the 2) and "e-mail" counts as two. Punctuation and spaces are compared but never counted. A paragraph present in both versions with at least one changed word is an edited paragraph; one present only in B is added, and one present only in A is removed. Changed paragraphs is the sum of those three.

An edited paragraph is recognised when the old and new text share enough of their characters. If a paragraph is rewritten almost entirely, it is instead reported as one removed paragraph and one added paragraph, and all of its words count on both sides.

Frequently asked questions

Can it compare a .doc, .odt or PDF file?

Not here. Save .doc and .odt files as .docx first. For two PDFs, use Compare PDF, which reads the text layer of each page.

Does it show formatting changes such as bold or a new font?

No. Only the characters of each paragraph are compared, so a word that became bold or changed colour is reported as unchanged.

Why do I see removed and added text for a paragraph I only moved?

The comparison keeps the order of each document. A paragraph that moved from page 2 to page 5 is gone from its old position and new at its new position, so it is shown in both places.

How does the report keep the document text from running as code?

Every piece of text from both files, including the file names, has its <, >, &, and quote characters replaced with HTML entities before it is written into the report. A paragraph that contains markup is therefore shown as literal text, and the report has no scripts of its own.