AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I compare two documents and see what changed?

Paste or upload your original document as A and the revised one as B in AnyTool Document Comparison. It aligns them and highlights every difference — added, removed, changed and moved segments — at paragraph, sentence, line or word level, in a side-by-side or unified view, with a change summary and similarity score. Everything is computed in your browser, so neither document is uploaded.

  • Compare at paragraph, sentence, line or word granularity
  • Side-by-side aligned view and a unified view
  • Detects moved blocks — content relocated, not just deleted and re-added
  • Change summary: added, removed, changed, moved, words and similarity
  • Export a change report (Markdown) and a unified .diff / .patch — 100% client-side

What is

Document Comparison

Document comparison is the process of placing two versions of a document side by side and identifying what was added, removed, changed or moved between them. Unlike a quick line differ, a document comparator works at paragraph or sentence level and can recognise relocated content, producing a readable redline and a change summary for editors, lawyers and writers.

Text Tools

Related terms

RedlineTrack ChangesDiff CheckerMoved-Block Detection

Frequently Asked Questions

No upload happens. The comparison runs entirely in your browser, so neither document leaves your device and it works offline.

Both documents are compared locally in your browser using JavaScript; large documents are processed in a Web Worker to keep the page responsive. Nothing is sent to a server, there is no tracking, and the page works offline after first load — so you can safely compare confidential contracts, drafts and reports.

A document comparator works at paragraph and sentence level and detects moved blocks, where a plain diff only marks lines or characters as added or removed.

A line or character diff is ideal for code and short snippets. Document comparison is built for longer prose: it splits each document into paragraphs, sentences, lines or words, aligns matching segments, highlights the exact within-segment edits, and recognises when a passage was moved to a new position rather than deleted and rewritten — then summarises everything as counts, a similarity score and a change report.

It matches a segment removed from one place to an identical or near-identical segment added elsewhere and reports it as a move rather than a delete plus an add.

When a paragraph or sentence is deleted from document A and the same content appears at a different position in document B, the tool links the two by a normalised content key and labels them a moved block — even if the passage was lightly edited, in which case it also highlights the within-segment changes. Move detection can be toggled off if you prefer a strict positional comparison.

Yes. You can copy or download a change report in Markdown and a standard unified .diff / .patch file.

Alongside the visual comparison, the tool builds a change report listing the summary, moved blocks and every added, removed, changed or moved segment, which you can copy or download as Markdown. It also generates a standard unified diff with @@ hunk headers that you can copy or save as a changes.patch and apply with git apply or the Unix patch command.

Detailed Explanation

Methodology

How Document Comparison Works

AnyTool Document Comparison compares two documents entirely in the browser. It first segments each document at the chosen granularity — paragraph, sentence, line or word — then runs a sequence diff (the Myers algorithm from the jsdiff library) over the segments to find the additions, removals and equal segments. Adjacent removals and additions are paired into in-place changes that carry a within-segment word highlight. Ignore-options are applied through a normalising comparator, so what counts as equal can change while the original text is always preserved.

  • Four granularities: paragraph, sentence, line and word
  • Sequence diff over segments, with word-level sub-highlighting on edits
  • Ignore case, whitespace or punctuation without altering the text
  • Large documents are compared in a Web Worker to keep the UI responsive
  • All computation is client-side JavaScript — no server round-trip
How It Works

Moved-Block Detection and the Change Summary

Beyond simple add and remove, the tool detects moved blocks: a segment deleted from one position and re-added at another is matched by a normalised content key and reported as a move rather than a delete plus an add, even when the passage was lightly edited. A change summary reports added, removed, changed, moved and unchanged segment counts, words added and removed, and both segment-level and word-level similarity percentages. The result can be read side by side or as a unified flow, with per-change navigation.

  • Moved blocks linked across positions, not shown as delete plus add
  • Move matching tolerates light edits and re-wrapping
  • Summary covers added, removed, changed, moved and similarity
  • Side-by-side and unified views with jump-to-next-change navigation
  • Change report exported as Markdown; redline computed locally
Privacy & Security

Privacy and Offline Use

Because the entire comparison runs in the browser, neither document reaches a server, there is no account or tracking, and the page works offline after first load. This makes it safe to compare confidential contracts, legal redlines, unreleased drafts and reports. The exported unified diff is a real .patch file that can be applied with git apply or the Unix patch command.

Document comparison: in-browser (AnyTool) vs typical online comparators
CapabilityAnyToolTypical online comparators
Document handlingProcessed in your browserUsually uploaded to a server
PrivacyNeither document leaves deviceMay log or store uploaded files
GranularityParagraph, sentence, line and wordOften line or word only
Moved-block detectionYes, with light-edit toleranceRare or experimental
ViewsSide-by-side and unifiedSometimes one view only
ExportMarkdown report + unified .patchOften PDF only or paywalled
Works offlineYes (PWA)No

Server-based comparators can retain uploaded documents in logs; AnyTool compares everything locally and uploads nothing. Competitor behaviour varies by plan.