Skip to main content
Calnex LogoCalnex
Text Tools

Text Diff Checker

Compare two texts side by side and find the differences. Shows lines added, removed, and unchanged with a similarity percentage. Essential for code reviews and document versioning.

Parameters

Results

Lines Added0
Other results (4)
Lines Removed0
Lines Unchanged1
Similarity
100%

1 of 1 total change units are identical

Unified Diff
--- original
+++ modified
 

Unified diff format showing additions (+) and removals (-)

Why Choose Text Diff Checker

The Text Diff Checker compares two texts line by line and highlights the differences using an LCS-based algorithm. It reports lines added, removed, and unchanged, calculates a similarity percentage, and outputs a standard unified diff format for developers.

  • ✓Line-by-line comparison using Longest Common Subsequence algorithm
  • ✓Unified diff output compatible with patch tools
  • ✓Similarity percentage showing how much of the text is identical
  • ✓Counts of added, removed, and unchanged lines at a glance

How to Use

  1. 1Paste the original (before) text into the first box.
  2. 2Paste the modified (after) text into the second box.
  3. 3Review the summary: added, removed, and unchanged line counts.
  4. 4Check the similarity percentage to gauge overall divergence.
  5. 5Copy the unified diff output for use in code reviews or patch files.

Frequently Asked Questions (FAQ)

What algorithm does this diff tool use?

It uses a Longest Common Subsequence (LCS) algorithm to find the optimal alignment between two texts, similar to the algorithm used by git diff.

What is unified diff format?

Unified diff is a standard text format showing context lines (space prefix), removed lines (- prefix), and added lines (+ prefix). It is widely used in version control and code reviews.

How is similarity calculated?

Similarity is the percentage of unchanged lines out of the total change units (added + removed + unchanged).

Is the comparison case-sensitive?

Yes. The comparison is case-sensitive and whitespace-sensitive. "Hello" and "hello" are treated as different lines.

Can I compare code files?

Yes. Paste code into both fields to see line-level differences. The unified diff output can be saved and applied as a patch.

Authoritative References & Sources

Wikipedia — Diff algorithm

View Source

Wikipedia — Longest common subsequence

View Source

GNU diffutils manual

View Source