Text Diff Merger
Compare two texts and interactively resolve differences — choose original or modified for each conflict, then copy the merged result
Two people edited the same config file. Git shows a merge conflict with <<<<<<< markers, but you want to see the actual differences highlighted — which lines changed, which were added, which were deleted — and pick the right version for each section, like a visual merge tool.
Why This Merger (Not the Diff Checker)
PureDevTools has a Diff Checker for comparing two texts and seeing differences. This tool adds interactive merge — see differences highlighted like a Git diff, then resolve each conflict by choosing the original or modified version. Use the diff checker for read-only comparison; use this merger when you need to produce a merged output.
What Is a Text Diff Merger?
A text diff merger goes beyond a plain diff viewer. It not only shows you what changed between an original and a modified version of text, but lets you interactively decide — conflict by conflict — which lines to keep in the final output. The result is a fully merged document you can copy and use immediately.
This is the same workflow that Git uses when you run git merge or git rebase and encounter conflicts: each conflicting block shows you both versions, you choose one (or manually edit), and Git writes out the resolved file. This tool brings that experience to the browser with a visual click-to-resolve interface.
How to Use This Merge Tool
- Paste your original text into the Original text area (left panel).
- Paste your modified text into the Modified text area (right panel).
- The Merge View appears automatically below. Unchanged lines are shown in a neutral colour; conflict blocks are highlighted in orange.
- For each conflict, you will see two panels:
- Original (red) — the lines from your original text
- Modified (green) — the incoming changes
- Click “Accept Original” to keep the original lines, or “Accept Modified” to use the incoming changes.
- Use “Accept All Original” or “Accept All Modified” in the toolbar to resolve all conflicts at once.
- The Merged Result text area updates in real time as you make decisions.
- Click Copy to copy the merged output to your clipboard.
Understanding the Merge View
Unchanged Lines
Lines that are identical in both the original and modified text are shown without a border and with no conflict indicator. They are always included in the merged output exactly as they appear. No action is required for these lines.
Conflict Blocks
A conflict block appears wherever one or more lines differ between the original and modified text. Each conflict block shows:
- An orange border to draw attention
- A header labelled “Conflict” with two action buttons
- The Original panel (red background) showing the lines that would be lost
- The Modified panel (green background) showing the incoming lines
The button of the currently selected choice turns solid (filled background), while the other button shows only an outline. The dimmer panel corresponds to the lines that will not appear in the merged output.
Default Choice
When you first paste text, all conflict blocks default to Accept Modified. This mirrors the behaviour of git merge where incoming changes are the default candidate. You can flip individual conflicts or bulk-flip all of them with the toolbar buttons.
Merge Statistics
The statistics bar below the input area shows:
- N conflicts — total number of conflict blocks found
- N original — number of conflicts resolved in favour of the original
- N modified — number of conflicts resolved in favour of modified
When there are no differences, the statistics bar shows either “Texts are identical” (for exact matches) or “No conflicts — texts merged cleanly” (for when the diff produces zero conflict blocks, which can happen if the merge algorithm detects purely structural insertions).
Difference from the Diff Checker
The Diff Checker tool on this site focuses on visualising differences: it shows you what changed, in both side-by-side and unified views, with character-level highlighting. It does not produce merged output and does not let you choose which version to keep.
The Text Diff Merger is purpose-built for the resolution step: you have two versions and you want to combine them into one final document. Common scenarios:
- You edited a config file and a colleague also edited it; you need to decide which changes to keep
- You have an old draft and a revised draft and want to selectively cherry-pick paragraphs from each
- You copied a code snippet to two places, made different changes to each, and now need to reconcile them
Algorithm
The merge view is computed using the Myers diff algorithm — the same O(ND) algorithm used by Git and GNU diff. It finds the shortest edit script between the two texts, which groups lines into three categories: kept (unchanged in both), removed from original, and added in modified. Consecutive removed-then-added lines are grouped into a single conflict block for review.
Because the underlying diff is optimal (Myers produces the minimum number of edits), the conflict blocks you see represent the true smallest set of disagreements between the two texts.
Common Use Cases
Code review reconciliation — When two developers edited the same function independently, use this tool to decide which changes to keep without losing either set of improvements.
Document revision merging — Combine feedback from two reviewers who each edited their own copy of a document.
Configuration management — Merge a vendor’s updated default config with your customised version, carefully preserving your overrides.
Copy editing — Compare a raw draft against a heavily edited version and selectively accept editorial changes.
Debugging — Compare a known-good version of a script against a modified version that introduced a bug, then selectively restore original lines.
Frequently Asked Questions
What is the difference between this tool and a standard diff viewer? A diff viewer only shows you what changed; it does not let you choose what to keep or produce a merged output. This tool adds the merge step: after seeing the conflicts, you click to resolve each one, and the result is a ready-to-use merged document.
Can I edit the merged result manually? The Merged Result area is read-only to prevent accidental editing (changes would be lost on the next conflict resolution click). To edit the result, copy it to your clipboard and paste it into your editor of choice.
What happens if one side has no lines in a conflict? This can happen when lines were purely added (original has zero lines, modified has one or more) or purely deleted (original has one or more, modified has zero). The empty panel will display a note indicating no lines exist on that side. Accepting the empty side effectively deletes those lines from the output.
Is there a limit on text size? The tool processes text entirely in your browser. The Myers algorithm is optimised for texts that are mostly similar (common in real-world edits), so performance remains fast even for large files. For two completely unrelated texts the algorithm has an internal cap and falls back to a single large conflict block.
Is my text sent to a server? No. All diff computation and merging happens entirely in your browser using JavaScript. Nothing is transmitted to any server. Your text remains completely private on your device.
Can I use this with code files? Yes. Paste the contents of any text-based file — source code, JSON, YAML, HTML, Markdown, plain text, SQL, configuration files. Binary files are not supported.