Apps Part of Wikinest

Wikinest Page Diff

Compare two versions of a page: added, removed and changed lines plus a unified diff.

More options

Try an example: ·

More about this tool

How it works

Compares two versions of a wiki page (or any text) line by line with the Myers algorithm, pairs replaced lines and marks the changed words inside them, counts added and removed words and writes a unified diff you can save as a patch. It is the comparison Wikinest shows in a page’s version history.

  • Both versions are split into lines (Windows and old Mac line ends become \n). With “ignore spaces”, runs of white space inside a line become one space and lines are trimmed before comparing.
  • The shortest edit script between the two line lists comes from Myers’ O(ND) algorithm after removing the common start and end. Deletions directly followed by insertions are paired as changed lines.
  • Inside each changed pair a second Myers diff over words, spaces and punctuation marks the changed words; added and removed words are counted from those marks and from whole added or removed lines.
  • Similarity = unchanged lines ÷ all rows of the side-by-side view. The unified diff uses the usual @@ -a,b +c,d @@ hunk headers with the chosen number of context lines.
  • Wikinest merges concurrent edits with the same line diff (a diff3-style three-way merge against the version both people started from).

Sources

Part of Wikinest

  • Wikinest Knowledge base and team wiki

    A team wiki: spaces, page trees, versions, comments and permissions per space.

    Open Wikinest

How to compare two versions of a page line by line

Find added, removed and changed lines between two versions of a text or wiki page, with word-level changes, a similarity score and a unified diff you can save.

What it is for

When a page changes, you want to know what changed. Rereading both versions does not tell you that. This tool compares an older and a newer version of a text. It lists every added, removed and changed line, marks the words that changed inside a line and writes a unified diff, the format code review tools use.

It works for any text: wiki pages in Markdown, meeting notes, configuration files or a contract clause. Wikinest uses the same comparison in the version history of every page and when two people publish the same page at the same time.

Worked example

Older version:

Deploy on Tuesday.
Ask Ada for access.
Run the smoke tests.

Newer version:

Deploy on Wednesday.
Ask Ada for access.
Run the smoke tests.
Write the release notes.

The tool answers:

Lines: 1 added, 0 removed, 1 changed. Words: 5 added, 1 removed.

Similarity is 50 %. The Changed lines table shows line 1 as changed (Tuesday → Wednesday) and line 4 as added. The unified diff starts with @@ -1,3 +1,4 @@: three lines of the old version starting at line 1 became four lines of the new version.

The built-in example, a release checklist, shows bigger changes. There are 2 added and 5 changed lines, 22 words added and 4 removed, and a similarity of 58.8 %. Several tasks went from - [ ] to - [x].

How to read the result

  • Added and removed lines exist on one side only. A changed line is a removed line directly followed by an added one. The tool pairs them so you can see the word differences.
  • Words added / removed count only the changed words inside changed, added or removed lines. Spaces and punctuation are not counted.
  • Similarity is the share of rows that stayed the same. 100 % means identical, and two unrelated texts come close to 0 %.
  • In the unified diff, lines starting with - were removed, + were added and a space means unchanged context. Each @@ header gives the start line and line count in the old and new version.

Tips and common mistakes

  • Paste the older version on the left (Older version). If you swap them, added becomes removed.
  • Use Ignore spaces and indentation when only the formatting changed, for example after re-indenting a list. Lines that differ only in spaces then count as unchanged.
  • Unchanged lines around each change only affects the unified diff, not the counts. Use 0 for the shortest diff.
  • Windows and Unix line endings are treated the same, so a file saved on another system does not show up as changed throughout.
  • Very long texts are fine. The table lists the first 300 changes, and the downloadable diff has all of them.

FAQ

Which algorithm does it use?

Myers' O(ND) difference algorithm on lines. It finds the shortest list of insertions and deletions, as in git diff. Changed lines are then compared word by word with the same algorithm.

Why is a moved paragraph shown as removed and added?

A diff only knows insertions and deletions. A paragraph that moved is deleted in one place and inserted in another. The words are the same, so the word counts stay balanced.

How does Wikinest merge two people's changes?

It compares both versions with the version they started from (a three-way merge). Changes in different places are combined automatically. If both people changed the same lines, the page gets conflict markers for you to resolve in the editor.

Is my text sent anywhere?

The comparison runs for this request only and the texts are not stored.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://wikinestpagediff.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://wikinestpagediff.usefulweb.app/mcp · tool name wikinest_page_diff
Example request
curl -s -X POST https://wikinestpagediff.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"before":"# Release checklist\n\nStatus: {status:yellow|In progress}\n\n- [x] Freeze the release branch\n- [ ] Run the smoke tests\n- [ ] Write the release notes\n\n## Commands\n```sh\ngit tag -a v2.4.0\n```\n\nAsk @[Ada] before tagging.\n","after":"# Release checklist\n\nStatus: {status:green|Done}\n\n- [x] Freeze the release branch\n- [x] Run the smoke tests\n- [x] Write the release notes\n- [x] Announce the release in #general\n\n## Commands\n```sh\ngit tag -a v2.4.0 -m \"Release 2.4.0\"\ngit push origin v2.4.0\n```\n\nAsk @[Grace] before tagging.\n"}'
Feedback · ideas & bug reports welcome