Text diff checker
The text diff checker compares two versions of text and shows exactly what changed, line by line — added lines in green with a plus sign and removed lines in red with a minus sign, just like a code-review diff. It is useful for proofreading edited documents, reviewing configuration file changes before deployment, comparing two versions of a contract clause, or quickly spotting what differs between two pasted paragraphs.
How the diff algorithm works
Both inputs are split into lines and compared using a longest-common-subsequence (LCS) algorithm. The LCS finds the largest set of lines that appears in the same order in both versions — these are the lines that didn’t change. Everything else is marked as a deletion (left text only) or an insertion (right text only), with line numbers shown for both sides.
Two optional modes adjust what counts as “the same”:
- Ignore case — treats uppercase and lowercase as identical before comparing, so a line that only changed capitalisation does not show as modified.
- Ignore leading/trailing whitespace — trims each line before comparison, hiding indentation-only changes. The original text is still what is displayed in the output.
Worked example
Left (original):
The meeting starts at 9am.
Agenda: budget review, roadmap.
Lunch break at noon.
Right (edited):
The meeting starts at 9am.
Agenda: budget review, Q3 roadmap.
Coffee break at noon.
The diff shows one unchanged line (The meeting starts at 9am.), then flags - Agenda: budget review, roadmap. as removed and + Agenda: budget review, Q3 roadmap. as added, and similarly for the lunch/coffee swap. Total: 2 removed, 2 added.
When to use each mode
| Scenario | Suggested mode |
|---|---|
| Comparing code or config | Default (case-sensitive, whitespace matters) |
| Proofreading a document | Ignore case, ignore whitespace |
| Reviewing a copied-pasted contract clause | Ignore leading/trailing whitespace |
| Checking if two paragraphs are identical | Both ignore options on |
Edge cases to know
A moved line is shown as both removed from its old position and added at its new one — the line-based algorithm has no concept of movement. Very large inputs (tens of thousands of lines per side) may be slower because comparison cost grows with the product of both line counts. Everything runs in your browser; neither version is ever uploaded.