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.
| 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 |
How to use
- 1Paste the "before"
The original text on the left side.
- 2Paste the "after"
The changed text on the right side.
- 3Read the diff
Added lines are green, removed lines are red, unchanged lines are grey. Line numbers match each side.
Examples
Before: "Hello, world!" After: "Hello, ToolVaults!"
- Hello, world! + Hello, ToolVaults!
Before: 3 environment lines · After: same 3 with debug=true added and log_level changed
APP_ENV=production - LOG_LEVEL=info + LOG_LEVEL=debug DATABASE_URL=... + DEBUG=true
Frequently asked
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.
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.
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
- Anagram CheckerCheck whether two words or phrases are anagrams. Options to ignore case, spaces,
- 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,