Text Diff

Compare two text blocks and find added, removed and changed lines.

Text A

Original text

Text B

Modified text

About Text Diff

Text Diff compares two blocks of text line by line and highlights lines that were added or removed. It can be useful for comparing source code, configuration files, SQL queries, documentation and other text-based content.

How to use Text Diff

  1. Paste the original text into Text A.
  2. Paste the modified text into Text B.
  3. Click Compare Text to compare both versions.
  4. Review the added, removed and changed line counts.
  5. Check the detailed diff output below the summary.

What is a Text Diff?

A text diff is a comparison between two versions of text. It identifies lines that remain the same, lines that were added and lines that were removed between the two versions.

Text comparison tools are commonly used when reviewing code changes, comparing configuration files, checking document revisions and identifying changes between two text versions.

Difference Types

Type
Symbol
Meaning
Added
+
A line exists in Text B but not in Text A.
Removed
-
A line exists in Text A but not in Text B.
Same
The corresponding line is unchanged.

Added, Removed and Changed Lines

Added lines are displayed with a plus sign and green styling. Removed lines are displayed with a minus sign and red styling. Lines that are replaced between versions contribute to both the added and removed counts, and the Changed count represents the smaller of those two counts.

When should you use Text Diff?

  • Compare two versions of source code.
  • Review changes in configuration files.
  • Compare SQL queries or database scripts.
  • Check revisions of documentation or plain text.
  • Find changes between two generated text outputs.

Text Diff vs JSON Diff

Text Diff compares text line by line, making it useful for source code, documents and other plain-text content. JSON Diff is designed specifically for comparing structured JSON data and can identify differences based on JSON object properties and paths.

Is my text uploaded to a server?

No. The comparison is performed directly in your browser using the text entered on this page. The tool does not need to upload your text to a backend server.

Input Limit

Each text input supports up to 100,000 characters. For very large documents, comparison performance can depend on your browser and device.