Compare Word DOCX files with tracked changes

weavon diff old.docx new.docx -o redline.docx compares documents semantically and writes native Word tracked changes.

Semantic document diff, not noisy XML

Zip-level XML diffs break whenever Word reorders attributes or splits runs. Weavon parses both files into a document tree and compares them block by block and word by word.

weavon diff contract-v1.docx contract-v2.docx --author "Legal" -o redline.docx

Six redline output formats

-o redline.docx
Writes native Word and tracked changes.
-o redline.pdf
Writes a color-coded PDF 1.7 redline with no TeX installation.
-o redline.html
Writes semantic HTML with and elements.
-t criticmarkup
Writes CriticMarkup insertions, deletions, and substitutions.
-t markdown
Writes a readable Markdown diff for pull requests.
-t json
Writes structured diff operations for automation and audits.

Compare across formats and languages

Because diff operates on the parsed document tree, you can compare Markdown against DOCX or run weavon.diff() inside Python, Node.js, HTTP, or the browser playground.

import weavon

docx_bytes = weavon.diff(old_md, new_md, "docx", author="Review")
pdf_bytes = weavon.diff(old_md, new_md, "pdf")

Generate a redline in three steps

  1. Write Word tracked changes

    Run weavon diff with an author name to emit native <w:ins> and <w:del> elements.

    weavon diff contract-v1.docx contract-v2.docx --author "Legal" -o redline.docx
  2. Export a PDF redline

    Switch the output extension to .pdf for a color redline without TeX.

    weavon diff contract-v1.docx contract-v2.docx -o redline.pdf
  3. Pin timestamps for CI

    Set SOURCE_DATE_EPOCH so repeated runs produce identical archive bytes.

    SOURCE_DATE_EPOCH=1700000000 weavon diff old.docx new.docx --author "CI" -o redline.docx

Common questions

Do weavon diff redlines open as real tracked changes in Word?

Yes. weavon diff writes native OOXML <w:ins> and <w:del> elements with author metadata that Microsoft Word, LibreOffice, and Google Docs display as tracked changes.

Can I diff two different formats, like Markdown and DOCX?

Yes. Weavon parses both inputs into the same document tree before computing the block and word diff.

Can I generate a PDF redline without LaTeX?

Yes. Pass -o redline.pdf and the embedded PDF engine draws insertions and deletions directly in pure Rust.

Can I try semantic diff in my browser?

Yes. Open the playground, switch to the Diff tab, and compare documents locally in WebAssembly.