Text Diff
Text Diff compares two texts (original and comparison) line by line, highlighting added lines in green and removed lines in red.
It uses the longest common subsequence (LCS) algorithm to find changes, and all comparison runs in your browser.
How to use
- Enter the original — paste the original (before) text into the left input box.
- Enter the comparison — paste the text to compare (after) into the right input box.
- Check the diff — press Compare to see added lines (+) in green and removed lines (-) in red.
Symbol reference
| Symbol | Color | Meaning |
|---|---|---|
+ | Green | Line newly added in the comparison |
- | Red | Line removed from the original |
| None | Present in both (unchanged) |
The comparison splits both texts on line breaks, finds matching lines with the longest common subsequence (LCS), and marks the rest as removals (-) and additions (+). It is handy for quickly checking changes in code, documents and translations.
Frequently Asked Questions (FAQ)
Is the diff line by line or character by character?
This tool compares line by line. It splits both texts on line breaks and uses the longest common subsequence (LCS) algorithm to find matching, added and removed lines.
What do the green and red colors mean?
Red (-) marks a line that existed in the original but was removed in the comparison, and green (+) marks a line newly added in the comparison. Lines with no color are unchanged lines present in both.
Are word-level changes within a line shown?
If a whole line differs, the tool shows it as both a removal (-) and an addition (+). Even when only a few words in a line change, it appears as a delete followed by an add at the line level, making the change easy to spot.
Is the content I compare sent to a server?
No. The comparison runs entirely in your browser, and the two texts you enter are never sent to or stored on a server.
Related tools & guides
- Line Break & Whitespace Cleaner — normalize whitespace in both texts before comparing.
- Remove Duplicate Lines — sort lines to make comparison easier.
- Word Counter — check the length before and after changes.
Last updated: 2026-06-25