Text Diff Merger

Three-way merge tool. Resolve conflicts between Base, Mine, and Theirs versions of text.

About This Tool

The Text Diff Merger is a free, browser-based three-way merge tool designed for developers who need to resolve text conflicts without installing desktop software. Three-way merging is the same technique that Git and other version control systems use internally when combining branches: it compares two modified versions of a file against their common ancestor (the base) to determine which changes can be applied automatically and which require manual intervention.

All processing happens entirely in your browser using a custom LCS (Longest Common Subsequence) diff algorithm implemented in JavaScript. Your data never leaves your machine — there are no server round-trips, no logging, and no third-party services involved. This makes it safe to merge sensitive content such as configuration files, environment variables, private API specifications, and proprietary source code.

When you click Merge, the tool computes a line-level diff between Base and Mine and between Base and Theirs, then walks both diffs simultaneously. Regions where only one side changed are applied automatically. Regions where both sides made identical changes are also resolved. Only when both sides changed the same region differently does the tool flag a conflict, presenting you with a clear visual interface to choose between the Base, Mine, or Theirs version for each conflict.

Unlike the read-only Diff Viewer tool, which compares two texts side by side, this tool is designed for merging: it produces an actual output that combines the best parts of both versions. It is particularly useful for resolving Git merge conflicts, reconciling configuration file changes across environments, and combining independent edits from multiple contributors. The tool also includes a simpler two-way diff mode for quick inline comparison when a base version is not available.

How to Use

  1. Select Three-Way Merge mode (the default) or Two-Way Diff for simpler comparisons.
  2. Paste the common ancestor text into the Base panel. This is the original version both sides started from.
  3. Paste your modified version into the Mine panel, and the other party's version into the Theirs panel.
  4. Click Merge (or press Ctrl+Enter) to compute the three-way merge.
  5. Review the merged output. Non-conflicting changes are applied automatically with color-coded highlighting: green for Mine, blue for Theirs.
  6. For each conflict (highlighted in red), click Use Mine, Use Theirs, or Use Base to resolve it. The conflict counter tracks your progress.
  7. Once all conflicts are resolved, copy the final merged text using the Copy button or Ctrl+Shift+C.

FAQ

What is a three-way merge?

A three-way merge compares two modified versions of a document against their common ancestor (the base). By examining what each side changed relative to the base, the algorithm can automatically combine non-overlapping changes and flag conflicting edits for manual resolution. This is the same technique used by Git, Mercurial, and SVN.

Is my data safe when using this tool?

Yes. The merge is computed entirely in your browser using JavaScript. No data is sent to any server, stored, or logged. You can safely merge sensitive files like environment variables, private keys, and proprietary configuration.

How does this differ from the Diff Viewer?

The Diff Viewer is a read-only comparison tool that shows additions, deletions, and modifications between two texts. The Text Diff Merger is an interactive merge tool that combines three versions into one, automatically resolving non-conflicting changes and providing a UI for resolving conflicts.

What happens when both sides change the same line?

If both sides made the exact same change, the tool accepts it automatically. If both sides changed the same region differently, a conflict is flagged. You can then choose between the Base, Mine, or Theirs version for that specific region using the resolution buttons.

What do the conflict markers look like?

Unresolved conflicts use standard Git-style markers: <<<<<<< Mine followed by your changes, ======= as a separator, then their changes, and >>>>>>> Theirs. These markers appear in the raw text output until you resolve each conflict.

Can I use this for Git merge conflicts?

Absolutely. When Git reports a merge conflict, you have the base version (from the merge base commit), your version (HEAD), and their version (the incoming branch). Paste each into the corresponding panel, merge, resolve any conflicts, and copy the result back into your file.

What is the two-way diff mode?

Two-way diff mode is a simpler comparison that shows an inline diff between two texts without requiring a base version. It is useful for quick side-by-side comparisons when you only have two versions of a file and do not need merge functionality.

Related Tools