Find and replace text literally, with optional case-insensitive and whole-word matching.
Text Diff Viewer
Compare two texts line by line with a longest-common-subsequence diff, the same approach git uses.
- Free
- No sign-up
- Runs in your browser
Input
0 characters
0 characters
Try an example
Fill in Original text and Changed text to continue.
Enter your input to see the result
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Paste the original on the left and the changed version on the right.
- 2
Added lines are marked green, removed lines red, and unchanged lines are shown for context.
- 3
A modified line appears as one removal plus one addition, because the comparison is per line.
Questions about Text Diff Viewer
How does the diff work?
It computes the longest common subsequence of the two line lists, the same algorithm behind the diff utility and git. That gives the minimal set of insertions and deletions, so the result matches what a developer expects from a code review.
Why is a small edit shown as a whole line changed?
Because this is a line-level diff. Changing one word marks the line as removed and the new version as added. That is the standard behaviour for source-control diffs; a word-level view would hide which lines moved.
Why is there a size limit?
The algorithm needs a table proportional to the product of the two lengths, so 4,000 lines per side keeps memory and time predictable in a browser tab. Larger comparisons belong in a desktop diff tool.
Is my text uploaded anywhere?
No. This tool runs as JavaScript inside your browser tab. There is no network request carrying your text, nothing is written to a server log, and the tool keeps working with your connection switched off. You can confirm it yourself in the browser’s network panel.
Does the Text Diff Viewer work offline?
Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the Text Diff Viewer keeps working with the network switched off and nothing is ever sent to a server.
Related tools
Other tools you might reach for next.
Find and replace with JavaScript regular expressions, showing every match and its capture groups.
Compare two documents in a side-by-side aligned view with additions, removals and unchanged lines marked.
Score how similar two texts are, with both edit-distance and bigram-overlap measures and the raw edit count.
Find repeated lines or words and report how often each appears and where.
Count words, characters, sentences, paragraphs and UTF-8 size, with all three definitions of "character" reported separately.
Count characters three ways - UTF-16 code units, Unicode code points and visible grapheme clusters - plus the UTF-8 byte size.
Count sentences using Unicode sentence segmentation, which handles abbreviations better than splitting on full stops.