Text diff

Compare two pieces of text line by line. Added lines are green, removed lines are red.

How text diff works

This tool compares two blocks of text and highlights the differences line by line. It implements a diff algorithm based on the longest common subsequence (LCS) approach — the same fundamental algorithm used by git diff and Unix diff. Lines present only in the first text are shown in red (deletions), lines present only in the second are shown in green (additions), and shared lines are shown without highlighting.

Text diff is useful for comparing document revisions, checking what changed between two versions of code or configuration, spotting differences in translated content, and verifying data exports. The line-by-line approach works best for structured content like code, CSV data, and prose with line breaks. For character-level diffing within lines (showing exactly which words or characters changed), more specialised tools are needed. All processing is browser-side — paste sensitive documents without concern about server transmission.

Related tools

Remove duplicates → Word counter → Case converter →

⚠️ Common Mistakes to Avoid