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.
Comparing two texts line by line
This is the tool to reach for when you want to establish what changed in a configuration file, or where a piece of writing was revised. It sets two texts against each other line by line and marks the added and deleted lines in distinct colours. Everything is computed inside the browser, so nothing you paste is sent anywhere.
**Worth knowing when reading the result is that a diff algorithm looks for the shortest sequence of edits.** As a consequence, **what a person sees as "this paragraph moved down" is expressed by the machine as a deletion paired with an addition.** There is no notation for a move as such. The other point is that comparison runs by the line, so **a line differing in a single character is reported as changed in its entirety.** The most confusing case here is a difference in line endings or trailing whitespace, which can mark every line as changed although nothing looks different. When a diff comes out improbably large, that is the first thing to suspect.
How to use it
- Paste the original into A Put in the contents as they were before the change.
- Paste the revision into B Put in the contents as they are after the change.
- Read the coloured differences **Added and deleted lines are shown in distinct colours.**
- Suspect the line endings when the diff is vast **A difference in line endings or trailing whitespace alone marks every line as changed.**
Tips for getting more out of it
- 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.
Where it comes in useful
Checking a change to a configuration file
Before it goes to production you can see that only what you meant to change has changed.
Collating the results of a revision
**Setting a draft against its rewrite lets you follow at a glance where the hand went in.**
Reviewing without Git
Files that were never under version control can still be compared simply by pasting them in.
Confirming that output is reproducible
Compare the results of running the same process twice and confirm that nothing diverges.
Diff terms
- Added line
- A line present only in B.
- Deleted line
- A line present only in A. **A line that has merely moved also surfaces as a deletion paired with an addition.**
- Line-based comparison
- A comparison treating each line as a unit. **A difference of one character marks the whole line as changed.**
- Line ending
- The character marking the end of a line: CRLF on Windows, LF on Unix-like systems. **A difference here can show up as every line differing.**
- Hunk
- A single block within a diff where the changes are gathered together.
- Context
- The unchanged lines shown above and below a changed one, included to make the position easier to place.
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.