Document Diff

Contact us
Original
Loading editor…
Changedstart typing to see diff
Loading editor…

How to use

1
Paste both documents

Paste your original text in the left editor and the changed version in the right editor. Both use Monaco — the same editor that powers VS Code — so you get syntax highlighting, line numbers, and a minimap out of the box.

2
Click Compare Documents

The tool runs Myers' diff algorithm on the two texts and computes exactly which lines were added, removed, or left unchanged. A stats bar shows the totals before you even scroll.

3
Review the diff

The result shows two read-only editors side by side. Removed lines are highlighted red in the Original (left). Added lines are highlighted green in the Changed (right). Both editors scroll in sync so corresponding content always stays aligned.

4
Edit and re-compare

Click "← Edit" to return to the input view with your texts intact. Adjust the options, fix a typo, or paste an entirely new document, then click Compare again.

Myers' diff algorithm

This tool uses Myers' algorithm (1986) — the same algorithm Git uses for `git diff`. It finds the shortest edit script: the minimum number of line insertions and deletions needed to transform the original document into the changed one. "Shortest" means the diff is as concise as possible, grouping related changes together and avoiding spurious matches that would make the output harder to read.

Options

Ignore whitespace
Collapses consecutive spaces and tabs into a single space before comparing, and trims leading/trailing whitespace from each line. Essential when comparing auto-formatted code, YAML with different indent widths, or JSON prettified with different spacers.
Ignore case
Converts both documents to lowercase before running the diff. Useful for SQL (identifiers are case-insensitive), file paths on Windows vs Linux, or any domain where capitalisation differences are not meaningful.

Features

Monaco editor
Both input and result panels use Monaco Editor (VS Code's engine). You get line numbers, a scrollable minimap, word wrap, and keyboard shortcuts for free.
Synchronized scrolling
In the diff result view, scrolling either panel automatically moves the other to the same position, so related lines in Original and Changed stay in view together.
Overview ruler
The thin strip on the right edge of each result editor (Monaco's overview ruler) shows red or green marks at every changed line — giving you a bird's-eye view of where changes are clustered in a long document.
Swap
The ⇄ button in the input view swaps Original and Changed instantly. Useful when you loaded the documents in the wrong order or want to view the diff in reverse.
Non-destructive editing
"← Edit" always returns to the input view with your text intact. Nothing is lost until you explicitly click Clear.