Loading tool…
How to Compare Two Texts
The Text Diff tool highlights exact additions, deletions, and modifications between two pieces of text — line by line or character by character.
- Paste the original text into the left panel and the modified text into the right panel.
- View the side-by-side diff with colour-coded additions (green) and deletions (red).
- Toggle between line-level and character-level diffing for the detail you need.
How Diff Algorithms Work
This tool uses the diff-match-patch algorithm developed by Google, which computes the minimal set of insertions and deletions needed to transform one text into another. The algorithm runs in O(n·d) time where n is the text length and d is the number of differences, making it efficient even for large documents.
Why Use Our Text Diff?
- Side-by-side view — see both texts with aligned changes for easy scanning.
- Character-level highlighting — spot single-character typos, not just whole-line changes.
- No upload required — both texts stay in your browser.
- Copy result — export the diff for documentation or code reviews.
Frequently Asked Questions
Can I compare code files?
Yes. The diff works on any plain text including source code, configuration files, and documentation. For code, the line-level view is usually most useful.
Is there a size limit?
There is no hard limit, but very large texts (over 1 MB) may slow down the browser. For most documents and code files the diff is instantaneous.
Does it detect moved lines?
The current algorithm detects insertions and deletions. A line that was moved will appear as a deletion at the old position and an insertion at the new one.
Is my text sent to a server?
No. The entire comparison runs locally in your browser.