Text Merge Tool

Compare and merge any text file side-by-side. Accept, reject, or combine changes and download the merged result.

Original (Left)
Loading editor…
Modified (Right)
Loading editor…

What is a Text Merge Tool?

A text merge tooltakes two versions of the same file and lets you combine them into one — choosing, change by change, which version to keep. It goes a step further than a plain diff: instead of just showing what's different, it lets you act on every difference and produces a single, final file as output.

This is useful any time two people, two branches, or two points in time produced different versions of the same content and you need one document that reflects the parts you actually want from each — without manually copy-pasting sections back and forth between files.

This page runs a full compare-and-merge workflow entirely in your browser. Paste or upload two files, compare them, resolve each change with Accept Left, Accept Right, Accept Both, or Reject, and download the merged result — nothing is ever uploaded to a server.

Compare vs Merge

Comparingtwo files answers one question: what's different between them? It highlights additions, removals, and changed lines so you can review them, but it doesn't produce a new file.

Merging uses that same comparison as a starting point, then lets you decide what to do about each difference — keep the original, take the new version, keep both, or discard the change entirely — and assembles those decisions into one merged file you can copy or download.

Supported File Types

Every upload or paste is treated as plain UTF-8 text, so there's no restriction by file extension. Common types include .txt, .html, .css, .js, .ts, .json, .xml, .yaml, .sql, .md, .csv, .log, .env, and .ini — and any other text-based file works the same way, since nothing about the diff or merge logic depends on the format.

When Should You Merge Files?

Reconciling a config file you edited locally with an updated version from a teammate or a deploy pipeline.

Combining two drafts of documentation, a README, or release notes without losing either author's changes.

Recovering from a failed find-and-replace by selectively pulling back the original lines that shouldn't have changed.

Merging a generated file (schema, lockfile-adjacent config, translation file) with manual edits made on top of an older version.

Examples

A few of the file types you can compare and merge — the same workflow applies to all of them.

Code Comparisonutils.ts
export function add(a: number, b: number) {
  return a + b;
}

export function multiply(a, b) {
  return a * b;
}
export function add(a: number, b: number): number {
  return a + b;
}

export function multiply(a: number, b: number): number {
  return a * b;
}

export function subtract(a: number, b: number): number {
  return a - b;
}
Configuration Files.env
APP_ENV=development
PORT=3000
DEBUG=true
API_URL=http://localhost:4000
APP_ENV=production
PORT=8080
DEBUG=false
API_URL=https://api.payloadtools.com
CACHE_TTL=3600
HTMLindex.html
<!DOCTYPE html>
<html>
<head>
  <title>My Page</title>
</head>
<body>
  <h1>Welcome</h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>My Page</title>
  <meta charset="utf-8" />
</head>
<body>
  <h1>Welcome to PayloadTools</h1>
  <p>Free developer tools.</p>
</body>
</html>
CSSstyles.css
.button {
  background: blue;
  padding: 8px;
}
.button {
  background: #2563eb;
  padding: 8px 16px;
  border-radius: 8px;
}

.button:hover {
  background: #1d4ed8;
}
JSONpackage.json
{
  "name": "my-app",
  "version": "1.0.0",
  "dependencies": {
    "react": "18.0.0"
  }
}
{
  "name": "my-app",
  "version": "1.1.0",
  "dependencies": {
    "react": "19.0.0",
    "next": "16.0.0"
  }
}
SQLschema.sql
SELECT id, name, email
FROM users
WHERE active = 1;
SELECT id, name, email, created_at
FROM users
WHERE active = 1
  AND deleted_at IS NULL
ORDER BY created_at DESC;
MarkdownREADME.md
# PayloadTools

Free developer tools.

## Features
- JSON tools
# PayloadTools

Free, browser-based developer tools.

## Features
- JSON tools
- Text compare & merge

## License
MIT
Log Filesapp.log
2026-01-01 09:00:01 INFO  Server started on port 3000
2026-01-01 09:00:05 INFO  Connected to database
2026-01-01 09:01:12 ERROR Failed to fetch user 42
2026-01-01 09:00:01 INFO  Server started on port 8080
2026-01-01 09:00:05 INFO  Connected to database
2026-01-01 09:00:06 INFO  Cache warmed
2026-01-01 09:01:12 WARN  Retrying fetch for user 42
2026-01-01 09:01:13 INFO  Fetched user 42

Feature Cards

Fast Browser Processing

Diffing and merging run instantly in JavaScript, no server round trip.

No Upload Required

Files are read locally in your browser and never transmitted anywhere.

Works with Any Text File

HTML, CSS, JSON, XML, SQL, Markdown, logs, config files, or anything else.

Character Level Diff

See exactly which characters changed inside a modified line, not just which lines.

Merge Changes

Accept left, right, both, or reject each change, then merge everything at once.

Download Result

Save the merged output using the original filename and extension.

Unlimited Usage

No signup, no rate limits, no watermarks — use it as much as you need.

Privacy First

Everything happens on-device. Your code and data stay yours.

Related Tools

Text Compare

Compare two blocks of text and highlight additions and removals.

Open Text Compare

Case Converter

Convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case and more.

Open Case Converter

JSON Compare

Compare two JSON objects side-by-side and highlight the differences. Supports tree view and raw diff.

Open JSON Compare

JSON Formatter

Beautify or minify JSON instantly. Format messy JSON into readable, indented output.

Open JSON Formatter

JSON Validator

Validate JSON syntax instantly. Get clear error messages for invalid JSON.

Open JSON Validator