Text Diff — Compare Two Texts Line by Line
Compare two blocks of text line by line and see exactly what changed. Runs entirely in your browser using a longest-common-subsequence algorithm.
Runs 100% in your browser — nothing is uploaded.
2 added 1 removed 3 unchanged
| 1 | 1 | Roses are red | |
| 2 | 2 | Violets are blue | |
| 3 | − | Sugar is sweet | |
| 3 | + | Honey is sweet | |
| 4 | 4 | And so are you | |
| 5 | + | Especially in this stanza |
Frequently asked
Which diff algorithm does this use?
A longest-common-subsequence (LCS) diff at the line level. Same family used by tools like Git diff, though not with the optimizations Git makes for very large inputs.
Does it work for code?
Yes — treat each line as a unit. It highlights added, removed, and unchanged lines. For fine-grained (character-level) diffs, use a code editor with a built-in diff view.
What is the max input size?
The algorithm is O(n×m) memory. Around 3,000–5,000 lines per side is comfortable; larger inputs will start to lag. For huge diffs, break them into smaller sections.
Related tools
- Case ConverterConvert text between 12 cases: lower, UPPER, Title, Sentence, camelCase, PascalC
- JSON FormatterFormat, validate, and minify JSON in your browser. See parse errors with line/co
- Line SorterSort lines alphabetically, numerically, or by length. Remove duplicates, trim wh
- Lorem Ipsum GeneratorGenerate placeholder text in classic Lorem Ipsum or six themed flavors: hipster,
- NATO Phonetic AlphabetConvert any text into the NATO phonetic alphabet — Alfa, Bravo, Charlie, Delta,
- Palindrome CheckerCheck if a word, phrase, or sentence is a palindrome. Optionally ignore case, sp