Text Diff Tool

Compare two texts and see differences highlighted line by line. Added lines in green, removed in red. Runs entirely in your browser.

Text Diff
+0 added -0 removed 0 unchanged

How the text diff works

The tool uses the Longest Common Subsequence (LCS) algorithm to find which lines are shared between the two texts. It then classifies every line as added (only in the modified text), removed (only in the original), or unchanged (present in both). The comparison runs entirely in your browser — no text is ever sent to a server.

Reading the diff output

Lines prefixed with + appear only in the modified text (added). Lines prefixed with - appear only in the original (removed). Lines with no prefix are identical in both versions. The "Copy unified diff" button exports the result in standard unified-diff format, compatible with git apply and most diff viewers.

When to use a text diff tool

Common use cases include: comparing two versions of a document or config file, reviewing changes in code snippets, spotting typos introduced between drafts, verifying that a translation matches the original structure, or auditing changes between contract revisions.

Frequently asked questions

How does the text diff work?

It uses the Longest Common Subsequence (LCS) algorithm to identify shared lines, then marks lines unique to the original as removed (red) and lines unique to the modified version as added (green). Unchanged lines are shown in grey.

Is my text sent to a server?

No. The comparison runs entirely in your browser. Your text never leaves your device.

What is the maximum text size?

The tool handles up to 600 lines per text for smooth browser performance. For larger files, a command-line tool like diff or git diff is recommended.

What is unified diff format?

Unified diff is a standard text format showing changes with + and - prefixes. It is the format used by git diff and can be applied to files with patch or git apply.

Step-by-step guide How to Compare Two Texts Online — Complete Guide →