Smart Text Compare & Merge

Compare, analyze, and merge text, code, and documents with visual diff highlighting, similarity scoring, and smart conflict resolution.

Visual DiffSmart MergeSimilarity ScoreFile SupportExport Reports

How to use

1

Add your text

Paste content into both editors, or upload files directly — TXT, CSV, JSON, XML, SQL, HTML, CSS, JS and more under 1 MB are accepted. Click Sample for an instant code-diff demo.

2

Pick a comparison mode

Choose Line for code diffs, Word for prose tracking, Character for letter-precision, or Paragraph for document review. Switch modes anytime — the diff recomputes instantly.

3

Tune ignore options

Mask whitespace-only changes, case differences, punctuation, or blank lines to focus on the differences that matter. Combine multiple ignore options for the cleanest result.

4

Merge & export

For each detected conflict, pick Accept Left, Accept Both, or Accept Right. The Merged Output rebuilds live. Copy the merge, download as TXT, or export an HTML diff report for sharing.

When to use text comparison

Code reviews

Compare two versions of a file outside your IDE — useful when reviewing pasted snippets, blog tutorials, AI-generated code, or vendor library changes.

Editing & proofreading

Track your editor's revisions on an article, contract, or marketing copy. Word mode reveals every inline edit so you can confirm nothing important was lost.

Merging reviewer edits

Two reviewers returned conflicting edits on the same draft. Use Merge mode to pick the best of both — Accept Left, Right, or Both per conflict — then export the final version.

SEO content auditing

Compare the live page copy against your latest CMS draft to verify what actually shipped. Paragraph mode is ideal for long-form content audits.

CSV & data diffs

Spot row-level differences between two CSV exports or two API JSON responses. Useful for QA testing API changes or comparing two database snapshots.

Legal & contract review

Track every edit between contract drafts. Generate an HTML diff report to share with stakeholders or attach to email — colour-coded for instant readability.

How it works

LCS diff engine

Both inputs are tokenized per your chosen mode, then run through a Longest Common Subsequence algorithm to compute the minimal edit script — the smallest sequence of add/remove operations that transforms one input into the other.

Hunk grouping

Adjacent add/remove operations are grouped into 'hunks' — discrete conflicts you can resolve individually. Each hunk gets a unique ID and an editable choice (left, right, or both), tracked in component state.

Live merge

The merged output recomputes on every change. The engine walks the original op sequence: equal blocks pass through unchanged, and each hunk emits whichever side(s) you selected — joined with the right separator for your chosen mode.

100% browser-side

All tokenization, diffing, merging, and report generation runs in your browser tab — no uploads, no server. Files you drop in are read with the FileReader API and never leave your device.

Frequently asked questions

Quick answers about this free online tool.

The tool uses a Longest Common Subsequence (LCS) diff algorithm. It tokenizes both inputs into the smallest units chosen by your comparison mode (lines, words, paragraphs, or characters), then computes the minimal edit sequence that transforms the original into the modified version. Each token is classified as equal, added, removed, or modified, and the results are rendered side-by-side with colour-coded highlights.

Similarity is the ratio of unchanged tokens to total tokens, expressed as a percentage. 100% means the two inputs are identical (under your current ignore options). 0% means they share nothing in common. The same texts can score differently in different modes — two paragraphs that share most words but rearrange them will score higher in word mode than line mode, for example.

Merge mode lets you resolve every difference between the two inputs by choosing which version to keep. For each conflict you can pick Accept Left (keep the original), Accept Right (take the modified version), or Accept Both (concatenate them). The Merged Output panel rebuilds the final document in real time as you make each choice — perfect for resolving competing edits from two reviewers or merging two drafts.

Yes — the tool reads any plain-text file under 1 MB, including SQL, JSON, XML, HTML, CSS, JavaScript, TypeScript, Markdown, YAML, and CSV. Use Line mode for line-by-line code diffs (the standard for git-style review) or Word mode to track inline edits like renames and signature changes. The diff is purely text-based — it doesn't parse code semantics, so reformatting will appear as a change.

TXT, CSV, JSON, XML, SQL, HTML, CSS, JS, JSX, TS, TSX, Markdown (.md), and YAML (.yml, .yaml). Anything that's plain text and under 1 MB will load. Binary files (images, PDFs, Word documents) are not supported — they would need to be converted to text first.

The LCS algorithm produces an optimal minimal edit script — it always finds the smallest set of changes that explains the difference. The 'feel' of the diff (whether two paragraphs read as 'modified' or 'one removed + one added') depends on your chosen mode and ignore options. For most use cases, Line mode with Ignore Whitespace gives the most intuitive code diffs; Word mode with Ignore Case gives the best results for prose.

Ignore Whitespace masks spacing-only changes (great for code reformatting). Ignore Case masks letter-case-only changes (useful when comparing emails, identifiers, or content that's been recapitalized). Ignore Punctuation focuses on the words themselves — useful for prose comparison. Ignore Blank Lines skips empty separator lines, which is helpful when comparing documents with different vertical spacing.

The LCS algorithm uses O(n × m) memory, where n and m are the token counts on each side. Two 1,000-line files compute instantly, but two 5,000-line files in character mode would need 25 million cells — which the tool blocks for safety. If you hit the size guard, switch to Line or Paragraph mode (much fewer tokens) or split the file into smaller sections.