Text Diff -- Compare Two Texts

Compare two texts and see differences highlighted. Free online text diff tool showing additions, deletions, and changes line by line. Runs in your browser.

Loading tool...

Frequently Asked Questions

How does text diff work?

This tool compares two texts line by line. Lines present only in the first text are marked as deletions (red). Lines present only in the second text are marked as additions (green). Unchanged lines are shown in the default color for context.

Can I compare code with this tool?

Yes. This tool works with any text including source code, configuration files, documentation, and prose. The line-by-line comparison format is similar to what you see in Git diffs and code review tools.

Does it handle large texts?

Yes. The diff runs entirely in your browser with no size limits other than available memory. For very large texts (thousands of lines), the comparison may take a moment to compute but results are displayed incrementally.

What diff algorithm is used?

This tool uses a line-by-line comparison approach that identifies the longest common subsequence between the two texts. This is the same fundamental approach used by tools like Git diff and Unix diff.

Built by Michael Lip. 100% client-side — no data leaves your browser.