Text Diff

Help

Overview

The text diff tool is an online tool that visualizes differences between two texts side by side. It highlights additions, deletions, and changes line by line, making it easy to review differences in code and documents.

How to Use

  1. Enter the original text (before changes) in the Original Text area.
  2. Enter the modified text in the Modified Text area.
  3. Click the "Compare" button to highlight the differences.
  4. To reset the input, use the clear button.

Specifications & Glossary

  • Diff algorithm (LCS): Uses an LCS (Longest Common Subsequence)-based diff algorithm. It finds the longest common subsequence between two sequences to identify additions and deletions.
  • Line-by-line diff: Compares text on a line-by-line basis and identifies changed lines. Displays each line's changes alongside the original.
  • Highlight color meanings: Green indicates lines added in the modified text; red indicates lines deleted from the original.
  • Side-by-side display: Displays original and modified text in parallel so changes in corresponding lines are immediately visible. Unlike unified diff (---/+++ format), you can see both before and after simultaneously.
  • Diff result structure: For each line, the original text, modified text, and highlight information are generated. Four states are identified: unchanged, added, deleted, and modified.

Use Cases

  • Reviewing changes before a code review.
  • Comparing configuration file versions.
  • Proofreading documents and tracking revisions.

Text Diff Tool

Text

Diff Result

Original
1
Modified
1
Added
Modified
Removed