Lesson 3
Word-Level Diff and Change Stats
Inspect small edits inside a changed line and read added, removed, changed, and unchanged counts.
Line-level diff tells you which line changed. Word-level diff tells you what inside the line changed.
Example:
LOG_LEVEL=info
LOG_LEVEL=debug
Line-level diff marks the whole line as changed. Word-level diff highlights only info → debug.
When word-level diff helps
Use word-level highlighting when:
- A host name changes slightly (
db.internal→db.prod.internal) - A boolean or number flag flips (
false→true) - A URL path or query parameter changes
- A SQL
WHEREclause changes one predicate - A JSON-looking line is still plain text and you want token-level clarity
Word-level diff is less useful when entire blocks were rewritten or reordered.
Reading change statistics
Good diff tools summarize the result:
- Added lines exist only on the right
- Removed lines exist only on the left
- Changed lines were replaced with a different line at the same position
- Unchanged lines match on both sides
These counts help you decide whether a diff is a small tweak or a large rewrite.
Example summary:
Added: 1 · Removed: 0 · Changed: 3 · Unchanged: 4
That usually means a targeted edit, not a full file replacement.
Key takeaway
Start with line-level diff for structure. Switch to word-level diff when the number of changed lines is small but the actual edit matters.
The Text Diff Checker supports both highlight modes and shows added, removed, changed, and unchanged counts in the status area.