Text Diff Comparison
Compare two blocks of text line by line and see added and removed lines highlighted in color. Useful for checking config file changes, proofreading documents, or reviewing code without Git. All diffing happens in your browser; nothing you enter is sent to a server.
Tips
- Paste the before and after versions of a config file (.env, YAML, JSON, etc.) to instantly see which lines were added or removed.
- Even without Git installed, you can do a lightweight code review or proofread a document just by copy-pasting two versions.
- A line that simply moved to a different position is detected as a removal plus an addition, not as a "move" — keep this in mind when reading the result.
- Whitespace, line breaks, and letter case are all compared strictly, so a line that only changed its indentation will still show up as changed.
- When comparing long prose, putting one paragraph per line before pasting makes the diff easier to read at a glance.
Frequently Asked Questions
Side Note — how LCS (Longest Common Subsequence) powers text diffing
The best-known algorithm for detecting differences between two texts is the "Myers diff algorithm," published in the 1970s by computer scientist Eugene Myers at IBM. The `diff` command in major version control systems like Git and SVN is built on this family of algorithms, efficiently detecting line-level additions and removals. This tool follows the same underlying idea, computing the Longest Common Subsequence (LCS) to narrow the result down to a minimal set of changes.
The Longest Common Subsequence (LCS) is the longest sequence that appears, in order, in both of two sequences being compared — here, the sequence of lines. The diff between two texts is found by treating every line not part of this LCS as either "removed" or "added"; the longer the LCS, the fewer changes appear on screen. A technique called dynamic programming (DP) makes this calculation practical even for texts with many lines.
Diff algorithms have a known weakness: when a line simply moves to a different position, most implementations do not detect it as a "move" — they show it as a removal paired with an addition instead. This is why comparing texts whose line order has been heavily shuffled can make the diff look larger than the actual change. Knowing this quirk helps you read diff results without being misled.