Skip to content

Text diff

Compare two texts line by line and download a readable report of added, removed, and unchanged lines.

Processed on your device

How it works & useful details

How to use this tool

Paste the original and changed text, choose any matching options, then compare. The report prefixes added lines with +, removed lines with −, and unchanged lines with two spaces. Download the complete report when the table preview is shortened.

How the result is calculated

This is a line comparison, not an executable patch or a character-level diff. Matching uses a longest common subsequence; moved lines appear as removals and additions. With ignored differences, unchanged rows display the original line. Case matching uses Unicode lowercasing without a language locale.

Line tools normalize CRLF and CR to LF. A final newline represents an empty final line; empty input has zero lines.

Limits: 100,000 UTF-16 code units and 1,000 lines per side, with at most 250,000 line pairs (for example 500 × 500). Split larger texts first.

About this tool

Text diff compares two blocks of text line by line and reports what was added, removed, or left unchanged. It is the quick way to see what changed between two versions without committing anything to git.

The comparison runs locally, and the readable report can be downloaded for a review. Whitespace and line-ending differences can be a source of apparent changes, so check those first if the result looks odd.

How to use it

  1. Paste the original text and the revised text.
  2. Run the comparison.
  3. Review the added, removed, and unchanged line groups.
  4. Download the report if you need to share it.

Worked example

Comparing "apples, bananas, cherries" (one per line) with "apples, blueberries, cherries, dates" gives:

  apples
- bananas
+ blueberries
  cherries
+ dates

The report shows 2 added lines and 1 removed line. A changed line appears as a removal followed by an addition, because the comparison works on whole lines.

Reading and using a diff

The algorithm finds the longest sequence of lines that the two texts share, then marks everything else as added or removed. That is the same idea behind git diff and most code review tools. A moved paragraph shows up as removed in one place and added in another.

Typical uses include comparing two versions of a contract clause, checking what changed between configuration files, and reviewing edits to a translated text. The "ignore case" and "trim whitespace" options hide differences that do not matter, such as indentation changes. For JSON documents, the JSON compare tool understands structure, so reordered keys are not reported as changes.

Frequently asked questions

What is the comparison unit?

Lines. A moved line appears as a removal and an addition rather than a move.

Why does a line show as changed when it looks the same?

Trailing whitespace, tabs versus spaces, or different line endings can make otherwise identical lines differ.

What is the limit?

Up to 100,000 characters and 1,000 lines per side, with at most 250,000 line pairs compared (for example 500 × 500 lines). Split larger documents into sections.