Text Diff
Compare two texts and highlight added, removed, and unchanged content at word or character level.
Awaiting Content
Enter text into both columns above to begin the line-by-line comparison analyzer.
Common Use Cases
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, 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, which suits 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: this is 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
What is the difference between line, word, and character granularity?
What algorithm is used to compute the diff?
What is unified view vs split view?
Why are some sections collapsed by default?
Related Tools
View all Text ToolsSort Lines
Sort any list of text lines alphabetically, numerically, by length or complexity. Remove duplicates and customize sorting options instantly.
Full-width Converter
Convert ASCII characters to Unicode full-width (abc123) and back, useful for styled text.
Binary ↔ Text
Convert text to binary (0s and 1s) and back in both directions, with live validation.