Text
Text Diff
Compare two texts line by line — what was added, removed, or changed, with word-level highlighting inside changed lines.
Text Diff compares two texts line by line and shows what was added, removed, or changed, with word-level highlighting inside changed lines — much like git diff, but without a command line.
How to use it
- Paste the original text into one field and the changed version into the other.
- The result immediately highlights added lines, removed lines, and the words that changed within shared lines.
- Handy for scanning large texts — jump straight to the first differences instead of searching manually.
Common uses
- Comparing two versions of a document, article, or config file without installing git.
- Checking exactly what changed in a text after an editor or an automatic formatter touched it.
- Comparing API responses or logs between two runs.
Things to keep in mind
By default a whitespace-only change (like indentation) still counts as a difference, since it technically changes the line's content.
The diff compares lines by position, so adding or removing a single line near the top can shift how the rest of the text lines up.
Article about this tool: Text Diff: how algorithms find the difference between two texts
Frequently asked questions
How is the comparison calculated?
The comparison happens line by line: each line is identified as added, removed, or changed, and within changed lines, the exact words that differ are highlighted.
How are additions, deletions, and changes displayed?
Added and removed lines are flagged as such in the result, and changed lines show word-level highlighting to immediately spot what changed without rereading the whole line.
Are my two texts sent to a server?
No, the comparison runs entirely in the browser in JavaScript — no content is sent anywhere.
Why does inserting a single line show every following line as changed?
The algorithm doesn't always correctly recognize that it's an insertion rather than a bulk replacement — especially when the surrounding lines are similar to each other. Good diff algorithms try to minimize these false positives by searching for the longest common subsequence, but it's not always perfect.
Does the comparison account for whitespace?
Yes, by default a change in whitespace alone (like indentation) is also flagged as a difference, since technically it's still a change to the line's content.