Merge three versions of a text file
Combine local and remote edits against a common ancestor, inspect conflicts and save the complete chosen text.
The selected file is read only after you click Run. Reading, checks and processing share one 10-second task period.
Input, work and complete-output limits apply to the entire request. Exceeding one refuses the result; see this tool’s limits.
Common ancestor
Local version
Remote version
Merged output
This is a bounded preview. Full diagnostics, matches and source data remain in the complete copy and downloads.
Before you start
Combine local and remote edits against a common ancestor, inspect conflicts and save the complete chosen text.
How to use this tool
- Open or paste the common ancestor, local version and remote version in their separate panes.
- Click Run to read the active sources within the complete task deadline.
- Review the merged output and each conflicting base/local/remote region.
- Choose each resolution or edit custom text; changing any source clears stale decisions.
- Save merged.txt when resolved, or conflicted.txt while unresolved, plus merge-report.json.
- Manually import the reviewed saved result into your original editor or workflow; keep the originals and merge report.
Supported inputs and limits
Provide base, local and remote independently. Each strict UTF-8 source allows 1 MiB and 4,000 exact line tokens. Base lines × (local lines + remote lines) allows 4,000,000 comparison cells.
Fixed node-diff3 3.2.1 Hunt–McIlroy line merge. CRLF, CR, LF and the missing terminal newline remain part of each line token. Open files to preserve original line endings; textarea editing may normalize endings.
Identical changes appear once. Unresolved conflicts retain LOCAL/BASE/REMOTE markers and are labeled unresolved; complete resolution downloads merged.txt. Reports and result text together allow 8 MiB.
Each conflict supports local, base, remote, local then remote, remote then local, or custom UTF-8 text up to 1 MiB. Compact resolution input allows 8 MiB before cloning; active choices also remain subject to the combined output limit. Unresolved is the default. Choose output BOM from base/local/remote or none; base is the default.
Conflict markers use LF. A separator LF is inserted when needed after an unterminated fragment and recorded by UTF-16 offset. No syntax-aware merge or automatic repository changes.
Each role uses either its pasted text or exactly one selected UTF-8 file. Empty text and genuine zero-byte files are valid merge sources; an invalid active file never falls back to hidden pasted text. Filename labels allow 512 UTF-8 bytes.
One leading BOM is removed and recorded, including pasted input. Invalid UTF-8, unpaired Unicode surrogates are refused. Inputs stay in this browser.
A fixed 10-second whole-task deadline or cancellation returns no partial export. Rerun after correcting the input; a fresh Worker starts each job.
File selection reads metadata only. The entire fixed 10-second period begins at Run and includes engine loading, input checks, reading, import and merging. Any cancelled or refused request publishes no partial copy or download.
Conflict IDs must refer to the current output; nonexistent or inactive IDs and custom text attached to another choice are refused. At most 12,000 IDs can arise from the three 4,000-line roles. Changing any source cancels active work and clears prior decisions and results.
The fourth pane is a bounded output preview. Copy retains the entire merged text; merge-report.json retains all blocks, conflicts, provenance and decisions. The complete copy and download both preserve the chosen leading BOM and have identical UTF-8 bytes; exact bytes/SHA-256 are reported.
This workbench accepts manually exported sources and produces a file for manual import. It does not invoke a Git CLI/mergetool, change a repository, validate code semantics or automatically mark a conflict resolved. Contents and names stay in bounded memory in this tab.
Worked example
Example input
base: a\nb\nc\nd\ne\n; local: a\nL\nc\nd\ne\n; remote: a\nb\nc\nR\ne\n
Example options
bom=base; resolutions={} (explicit dedicated controls)Example output
a\nL\nc\nR\ne\n; merged.txt + merge-report.json
When something does not work
Confirm the common ancestor and selected roles. Reduce line work if over budget, then rerun. Keep unresolved output labeled as conflicted until every conflict has an explicit resolution. Empty sources are valid. After cancellation, rerun the same roles. After a source change, review new conflict IDs and re-enter decisions.
Frequently asked questions
Can I use an empty source?
Yes. Empty pasted text and a genuine zero-byte file are valid for any of the three roles. Three empty sources produce resolved empty text; this does not activate another hidden input.
How does the output BOM work?
One leading BOM is removed and recorded from each source. Choose base, local, remote or none; base is the default. A source policy adds a BOM only if that source had one. Complete text copy and download both follow the selected policy, preserve the same leading BOM and have identical UTF-8 bytes.
Does a selected side automatically resolve the repository conflict?
No. Apply the decisions to recompute the complete merge, save the result and review/import it manually in your own workflow. Unresolved output is named conflicted.txt, not merged.txt.
Documentation & further reading
Related tools
Convert text encoding
Choose the right text encoding and save a readable TXT file.
Merge text files
Put several text files together in the order you choose.
Word counter
Words, characters, and paragraphs at a glance.
Case converter
Change letter case to suit your text.