# Three-Way Text Comparison & Merge Suite

Line/word/char diff with ignore rules, three-way merge with conflict markers, and unified patch

> Canonical page: https://elysiatools.com/en/tools/three-way-text-comparison-merge-suite

- **Category:** Text Processing

- **Keywords:** three-way merge, diff, text comparison, merge conflict, patch, unified diff, git merge, diff3

## Overview

Compares two texts at line, word, or character granularity with optional case/whitespace ignoring, performs a three-way merge of two branches against a common ancestor (marking conflicts Git-style), and emits a unified patch. Based on jsdiff (LCS). Pure local — no AI, no network.

## Inputs

- **Base / ancestor (O)** (textarea): Common ancestor text (required for 3-way merge)
- **Branch A (ours)** (textarea): First text / our branch
- **Branch B (theirs)** (textarea): Second text / their branch
- **Mode** (select)
- **Granularity** (select)
- **Ignore case** (checkbox)
- **Ignore whitespace** (checkbox)
- **Context lines** (number)

## When to use

- Review additions, removals, and changes between two versions of a text.
- Combine two edited branches while checking for changes made in the same area.
- Create a unified patch showing how to change Branch A into Branch B.

## How it works

- Enter Branch A and Branch B in the two required text areas.
- For a three-way merge, also enter the common ancestor in the Base / ancestor field.
- Choose Two-way diff, Three-way merge, or Patch, then select line, word, or character granularity.
- Optionally ignore case or whitespace and set the number of context lines for patch output.

## Use cases

- Compare revised documentation, configuration text, or source code at the level that best exposes the change.
- Merge independent edits from two branches using a common ancestor and identify overlapping changes.
- Prepare a compact unified patch for reviewing or communicating text changes.

## Frequently asked questions

### What inputs are required?

Branch A and Branch B are required. A Base / ancestor text is needed for three-way merge mode.

### What comparison levels are supported?

You can compare text by lines, words, or characters.

### Can the comparison ignore case or whitespace?

Yes. Enable Ignore case or Ignore whitespace before running the comparison.

### How are three-way conflicts shown?

Conflicts are marked with Git-style conflict markers so you can review both branch changes.

### What does Patch mode produce?

Patch mode produces a unified patch describing the changes from Branch A to Branch B.

## Related tools

- [Advanced Duplicate Line Remover](https://elysiatools.com/en/tools/advanced-duplicate-line-remover): Detect and remove duplicate lines with advanced options for mode, case sensitivity, and trimming
- [Remove Duplicate Lines](https://elysiatools.com/en/tools/remove-duplicate-lines): Deduplicate lines in a list or text block. Keep the first or last occurrence, with options for case sensitivity, whitespace trimming, and dropping empty lines.
- [Text Repeater](https://elysiatools.com/en/tools/text-repeater): Repeat text N times with a chosen separator — inline, new line, or a numbered countdown. The quick tool for chat spam, dramatic build-ups, and social-media effect.
- [Whitespace Normalizer](https://elysiatools.com/en/tools/whitespace-normalizer): Replace consecutive spaces/tabs with single space and trim line start/end whitespace
- [Smart Quote Wrapper](https://elysiatools.com/en/tools/quote-wrapper): Wrap whole text, lines, or sentences with typographic quotes, nested quote pairs, and language-aware punctuation.
- [Strikethrough Text](https://elysiatools.com/en/tools/strikethrough-text): Add a strikethrough line through every character via the Unicode combining mark U+0336. Plain text — no markdown needed.
- [Add Symbols Around Words](https://elysiatools.com/en/tools/text-add-symbols-words): Quickly add patterns before and after each word in text
- [Text Diff](https://elysiatools.com/en/tools/text-diff): Compare two text inputs and show differences

## Samples

- [Text with Emoji Samples](https://elysiatools.com/en/samples/text-with-emoji-samples): Mixed language text containing various Unicode emojis for testing emoji extraction
- [Truffle Development Suite Samples](https://elysiatools.com/en/samples/truffle-samples): Truffle Ethereum development framework examples including smart contracts, testing, deployment, migrations, debugging, and development workflows
- [Chinese-English Mixed Text Samples](https://elysiatools.com/en/samples/text-chinese-english-mixed-samples): Sample text files with mixed Chinese and English content for testing automatic spacing tools
- [Text Case Format Samples](https://elysiatools.com/en/samples/text-case-formats): Examples of different text case formats: camelCase, snake_case, kebab-case, PascalCase, and more

## Related content

- [Text Case, Encoding, and Normalization Conversion Tools](https://elysiatools.com/en/hubs/text-convert): Compare text case conversion, character-width conversion, encoding conversion, quoted-printable handling, and inline text normalization tools in one hub.
- [Text Tools](https://elysiatools.com/en/hubs/text-utility): Explore 33 text tools for utility workflows and compare closely related utilities quickly.
- [Text Analysis, Readability, and Content Inspection Tools](https://elysiatools.com/en/hubs/text-analyze): Compare text statistics, language detection, readability scoring, sentiment analysis, moderation review, and pattern analysis tools in one hub.
- [Text Redaction, Highlighting, and Presentation Formatting Tools](https://elysiatools.com/en/hubs/text-format): Compare tools for masking sensitive text, finding PII, normalizing phone numbers, highlighting phrases, centering text, and formatting diffs in one hub.
