Text
Diff

Compare two text blocks and highlight differences line by line.

Input

Diff Output

0 added0 removed1 unchanged

Enter text in both fields to see the diff.

Learn more

How does a computer figure out what changed between two versions of text?

Was this useful?

Frequently Asked Questions

The tool uses a longest common subsequence (LCS) algorithm to find the optimal alignment between lines. This produces minimal, accurate diffs similar to the Unix diff command.

Yes. The diff output recalculates instantly every time you change either input field. There is no button to click — results appear as you type or paste.

Yes. The diff output uses a monospace font and preserves whitespace, making it suitable for comparing code, configuration files, JSON, and any line-based text.

Green lines with a + sign were added in the modified text. Red strikethrough lines with a - sign were removed from the original. White lines are unchanged.