About Text Diff
Paste an original and a revised version to see every difference highlighted: additions in one colour, deletions struck through in another. Compare by line for code and config files, by word for prose, or by character when you are hunting a single stray symbol.
You can ignore case or whitespace changes to focus on what matters, and copy the result as a standard unified diff.
How it works
- Both texts are split into lines, words or characters, depending on the comparison level you choose. Words are found with the browser’s language-aware segmenter, and a character is what you see: an emoji, a flag or an accented letter is one character.
- A longest-common-subsequence algorithm finds the smallest set of insertions and deletions that turns the original into the changed version.
- Unchanged text is shown plainly, with insertions and deletions marked inline. Line comparisons also produce a unified diff you can save as a patch.
- The comparison runs in a Web Worker, so the page stays responsive while it works. A search for differences that has not finished after five seconds is stopped and reported.
Questions
Which comparison level should I use?
Lines for code, logs and data files. Words for articles, contracts and emails. Characters for short strings such as ids, keys or a single sentence.
Can I compare JSON or other structured data?
Yes, but format both sides the same way first, ideally with sorted keys, so that the comparison shows real changes rather than layout differences.
Is there a size limit?
Each text can be up to 1 MB; more than that is turned away with a message. There is also a time limit. The work grows with the number of differences more than with the length: files with tens of thousands of lines and scattered edits compare almost at once, while two long texts that share most of their lines, words or characters in a different order can exceed the five seconds allowed. You are then asked to compare by a coarser level or in shorter sections.
Why does it say only spacing or punctuation differs?
At word level the summary counts words. When every word is the same but a space, a line break, a comma or a symbol changed, no word was added or removed, so the summary says so and the changes are still highlighted. Turn on "Ignore whitespace changes" to leave spacing out of the comparison.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.