3-Way Text Diff & Merge Viewer
Merge two edited versions of a text against their common base (a 3-way diff, like a Git merge). Auto-resolves non-overlapping edits and reports conflicts with a line-by-line status table.
Input
Which side wins where local and remote both edited the same lines differently.
Output
Summary
| Metric | Value |
|---|---|
| No data yet | |
Line-by-line Diff
| Status | Base | Local | Remote |
|---|---|---|---|
| No data yet | |||
Guides
What is a 3-way text diff and merge?
A 3-way merge compares two edited copies of a document — a local version and a remote version — against the common ancestor they both started from (the base). This is exactly what Git, Mercurial and other version-control systems do when merging branches, but this tool does it for any plain text: config files, prose, code snippets, CSV rows, anything line-based.
Instead of a plain two-way diff (which only tells you what changed), a 3-way merge tells you who changed it and whether the edits can be combined automatically:
- Lines untouched by both sides are kept as-is.
- Lines edited on only one side are merged in automatically.
- Lines edited identically on both sides count as a single agreed change.
- Lines edited differently on both sides are flagged as a conflict for you to resolve.
How to use it
- Paste the Base text — the original, common-ancestor version.
- Paste Local and Remote — the two versions that each started from that base and diverged.
- Pick what happens On Conflict: show Git-style conflict markers (
<<<<<<</|||||||/=======/>>>>>>>) for manual resolution, or auto-resolve every conflict by preferring local, preferring remote, or falling back to the base text. - Read the Merged Text box for the combined result, the Summary table for a quick conflict count, and the Line-by-line Diff table for a full breakdown of every unchanged, changed, or conflicting region.
The result updates live as you type — no need to click a button.
How conflicts are detected
The tool aligns each version's lines against the base using a longest-common-subsequence (LCS) line diff, the same technique behind most text-diff tools. Matching lines found in both the local and remote diff anchor the three texts together; everything between two anchors is compared as a block. A block becomes a conflict only when both sides changed it and their changes disagree — an edit made on just one side merges in cleanly every time.
FAQ
Does this replace git merge?
No — it's a lightweight, browser-based approximation useful for merging text outside a Git workflow (e.g. two people editing the same document, or reconciling config drift). It doesn't touch your repository or file system.
What do the conflict markers mean?
<<<<<<< LOCAL through ======= is your local version's conflicting lines; ======= through >>>>>>> REMOTE is the remote version's; the ||||||| BASE section in between shows the original text for reference — the same convention Git uses in a merge conflict.
Why did a line I didn't touch show up as changed? The diff works on whole lines. If a line shifted position because lines above it were added or removed, it can be re-matched differently by the LCS algorithm. Breaking long paragraphs into shorter lines usually gives more precise results.
Is there a size limit? Yes — each version is capped at 2,000 lines to keep the comparison fast in your browser. Longer documents should be split into smaller sections.
Privacy
Everything runs entirely client-side in your browser. Your text is never uploaded or sent to a server.