Text Diff

Compare two texts and highlight added, removed, and unchanged content at word or character level.

Everything runs in your browser. Your data never leaves your device.
Original Text
Changed Text

Paste text in both panels, then click Find Differences

Supports code, config files, prose, and more

Common Use Cases

Compare two versions of a legal contract to identify what was changed between drafts
Verify that an AI-generated rewrite preserved the meaning and structure of the original
Check whether a configuration file was modified correctly after a deployment
Find subtle differences between two nearly identical code snippets during a code review

About Text Diff

Text diffing is the process of computing and displaying the differences between two versions of a text. It's fundamental to version control systems like Git, which uses diff algorithms to track what changed between commits. But the use cases extend far beyond code: comparing two versions of a legal document, checking whether an AI-generated rewrite changed anything unexpected, verifying that a translated text has the same structure as the source, or auditing the differences between two configuration files.

The core algorithm is the Longest Common Subsequence (LCS) problem. Given two sequences, find the longest subsequence present in both in the same order. The diff is then: elements only in the first sequence are "deleted", elements only in the second are "inserted", and elements in the LCS are "unchanged". The Myers diff algorithm is the most widely used implementation — it's used by Git, GNU diff, and most modern diff tools.

This tool implements three levels of granularity. Line-level diff shows which entire lines were added or removed — suitable for code files and structured text. Word-level diff shows which words changed within each line — useful for prose and documents. Character-level diff shows exactly which characters changed — useful for finding typos, subtle encoding differences, or near-identical lines.

Unchanged lines far from any change are collapsed by default (with ±3 lines of context shown around each change) to focus attention on what's different. Both unified view (single column, like Git's diff output) and split view (side-by-side, like GitHub's diff) are supported.

Frequently Asked Questions