Text Diff
Side-by-side diff comparison of two text blocks with line-by-line highlighting. Shows added, removed, and changed lines — useful for comparing document versions or config files.
apple
+blueberry
−banana
cherry
+date
How to use the text diff
Paste two versions of text. Lines unique to the first are marked −, lines unique to the second are marked +.
Formula & explanation
Longest common subsequence (LCS) algorithm — O(n × m) time and space. Suitable for short documents.
Examples
Compare two configs to spot what changed; compare two paragraphs to see edits.
Frequently asked questions
- What does the diff output mean?
- Lines prefixed with − exist only in the original text; lines prefixed with + exist only in the modified text. Lines with no prefix are identical in both versions.
- Does this tool do word-level or character-level diffing?
- This tool diffs at the line level. For a word-by-word comparison, break your content onto separate lines (one word or phrase per line) before pasting.
- What algorithm is used?
- The Longest Common Subsequence (LCS) algorithm, the same technique used by the Unix diff utility and most version control systems.
- Is my pasted text sent to a server?
- No. All diffing runs entirely in your browser. Nothing you paste leaves your device.
Related text & string tools
- Sort Lines / Sort List OnlineSort a list of words, names, or numbers — alphabetically A→Z or Z→A, numerically, or randomly. Paste any list and get sorted results instantly.
- Text ReverserReverse the characters, words, or individual lines of any text. Useful for debugging palindromes, creating mirror text, or just having fun with strings.
- Find & ReplaceBulk find and replace across any block of text with plain text or regex patterns. Supports case-sensitive matching, global replace, and regular expression capture groups.
- Lorem Ipsum GeneratorGenerate paragraphs, sentences, or words of classic lorem ipsum placeholder text. Choose the amount and copy instantly — useful for mockups, wireframes, and design prototypes.
- Word & Text CounterCount words, characters, lines, sentences, and reading time instantly. Paste any text — article, essay, or code — and get a live breakdown. Also shows unique word count and average word length.
- Text to URL SlugConvert any title or string into a clean, hyphenated URL slug. Strips accents, punctuation, and spaces. Useful for generating SEO-friendly URLs and blog post paths.