b2KIT

Text Diff & 3-Way Merger

Three-way merge tool: paste base text, version A, and version B. Highlights conflicts and lets you click to resolve.

How to Use Text Diff & 3-Way Merger

  1. 1

    Paste both versions

    Enter the original text and the modified version.

  2. 2

    Review the diff

    See changes highlighted as additions, deletions, and modifications.

  3. 3

    Merge selectively

    Choose which changes to accept or reject in the final output.

  4. 4

    Copy merged text

    Click copy to grab the merged result.

Tested tool guide Text and writing tools Checked August 16, 2026

What Text Diff & 3-Way Merger does, with a checked example

This tool takes three pasted texts - the base, version A, and version B - and returns the single document that keeps every edit each side made, flagging only the spots where both sides rewrote the same lines. One-sided changes are applied automatically; each conflict is highlighted and you click to resolve it, picking one side. The usual surprise: this is not a comparison of A against B. Two versions that read completely differently can merge with zero conflicts when their edits land on different lines of the base, while a one-word change to the same line on both sides demands a decision. Pasted text stays in the browser.

Worked example

A concrete input and expected output from the current implementation.

Input

Base:
The cat sat
on the mat
in the sun

Version A:
The cat slept
on the mat
in the sun

Version B:
The cat dozed
on the mat
in the rain

Expected output

Line 1 is highlighted as a conflict showing both candidates: 'The cat slept' (A) and 'The cat dozed' (B). Line 2, 'on the mat', matches the base in both versions and appears once. Line 3 reads 'in the rain' with no prompt, because only B changed it. Clicking A on the conflict yields: The cat slept / on the mat / in the rain.

Both versions rewrote line 1 differently, so no side wins automatically and the click is required. Line 2 is untouched everywhere, and only B touched line 3, so those two resolve without asking.

How the result is produced

1

Comparing each version to the base, not to each other

The tool splits each paste into lines and diffs A against the base and B against the base. A line both versions left alone is kept once. A line only one side changed is taken from that side. A line both sides changed, into different text, is a conflict. Two versions sharing text proves nothing: only agreement with the base marks a line as untouched. This is the same diff3 family git uses for merge-file.

2

Click-through conflict resolution

Each conflict region is shown with both candidates, and clicking one drops it into the result; the final document is assembled one decision at a time. Regions only one side touched never prompt. The tool never favors a side automatically, and it does not judge whether the outcome is coherent - resolving the last conflict simply ends the process, so read the full result before copying it out.

Good uses

  • Two people (or two AI assistants) edited the same draft from the same original, and you want one file that keeps both sets of edits while forcing you to adjudicate the overlapping ones.
  • A configuration or data file on two machines has drifted from the same template; recombine them, keeping each machine's intentional changes and surfacing the overlaps for a decision.
  • A version-control merge produced conflict markers you do not want to hand-edit, or you are on a machine without the repository; paste the three blobs here and click through the conflicts instead.

Limits and checks

  • The base must be the true common ancestor. Paste one of the edited versions as the base and the comparison silently degrades: the other version's changes look like the only edits, shared edits become invisible, and the tool can no longer tell who changed what.
  • Comparison is line-based, so formatting counts. A paragraph that one side re-wrapped counts as a rewritten block, and if both sides re-wrapped the same paragraph you get a conflict even when the words agree.
  • A conflict-free merge is not a review. The tool guarantees each region came from one of the three inputs, not that the result is coherent. Both sides can carry the same mistaken edit, which merges silently as a non-conflict, and an auto-applied one-sided change can still be wrong - read the whole merged document before using it.

Common questions

If only one side changed a line, does it always take that side?

Yes. A change made by only one of the two versions is assumed intentional and applied automatically; only lines both versions changed, into different text, require a click. This is standard three-way behavior, the same logic as git merge-file, so it should feel familiar if you have merged branches. The final text is editable before you copy it if an auto-applied change is not what you wanted.

Can I merge without the base - I only have the two versions?

Not as a true three-way merge. With an empty base there is no common reference, so the tool aligns the versions by position and every differing line becomes a conflict, which you then resolve by hand. Paste the closest thing you have to the common ancestor - an earlier export, a saved copy, the original template - and the tool can recognize one-sided edits properly.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools