📄 Online Diff

📝
📄
⚙️
⚡
📊
Text 1:
{{ stats.text1.lines }} lines, {{ stats.text1.words }} words
Text 2:
{{ stats.text2.lines }} lines, {{ stats.text2.words }} words
Removed:
{{ stats.changes.removed }} lines
Added:
{{ stats.changes.added }} lines
Modified:
{{ stats.changes.modified }} lines
🔍
{{ line.line1 }}: {{ line.text1 ||'' }}
{{ line.line2 }}: {{ line.text2 ||'' }}
{{ line.prefix }} {{ line.lineNumber }}: {{ line.text }}
{{ line.text }}
✅

The two texts are identical (considering your selected options).

💡

Enter text in both input areas to see the differences.

⚠️ {{ error }}
🔄 Comparing texts...

ℹ️ About Online Diff Tool

Online Diff Tool compares two text inputs line by line and marks the additions, removals, and changed lines needed to turn the original text into the modified text. It is useful for reviewing code snippets, configuration files, release notes, contracts, emails, CSV fragments, and any plain text where the exact wording or line order matters.

When to use it:

  • Compare two versions of a config file before deploying a firewall, DNS, proxy, or application change.
  • Check edited text for accidental deletions, duplicated lines, or wording changes.
  • Review copied command output, logs, JSON-like text, CSV rows, or policy text without opening a full editor.
  • Prepare a human-readable summary of what changed before pasting it into an issue, ticket, or review.

Diff views:

  • Side-by-side places the original and modified lines in parallel columns for quick scanning.
  • Unified uses the familiar patch-style prefixes: unchanged context lines, - removals, and + additions.
  • Inline lists the comparison in reading order when a compact change log is easier to copy.

Example: comparing listen 80; with listen 443 ssl; will show the old line as removed and the new line as added or modified, depending on the selected view. Turn on Ignore case for case-insensitive prose checks, or Ignore whitespace when spacing and indentation changes are not meaningful.

Standards and references: the classic diff utility is specified by the POSIX diff utility. Unified context output is documented in the GNU Diffutils unified format manual, and Git extends diff output for repository metadata as described in the Git diff format documentation.

Limitations: this tool is line-oriented and does not understand programming language syntax, document formats, binary files, or semantic moves. Ignoring case or whitespace can hide meaningful changes in passwords, tokens, code, YAML, Makefiles, and other spacing-sensitive formats. Very large inputs may also be slower in the browser. The interactive page compares text locally in the browser; API use sends the submitted text to the server endpoint.

API Usage Example:

POST /api/tools/text/diff
Content-Type: application/json

{
    "text1": "Hello world\nThis is line 2",
    "text2": "Hello universe\nThis is line 2\nThis is line 3",
    "diffType": "side-by-side",
    "ignoreCase": false,
    "ignoreWhitespace": false
}
Ready