What Is a Text Diff Checker?
A text diff checker takes two pieces of text — an original and a modified version — and computes exactly what changed between them. Changed lines are highlighted in color: green for lines that were added, red for lines that were removed, and gray for lines that stayed the same. This makes it immediately obvious which parts of a document changed without having to read every word manually.
This tool runs the Myers diff algorithm entirely in your browser. Nothing is sent to a server. Paste both texts, click Compare, and see the result instantly.
How to Use the Diff Checker
- Paste the original text into the left panel.
- Paste the modified text into the right panel.
- Click Compare (or press Ctrl+Enter).
- Read the diff output below: green lines are additions, red lines are removals, gray lines are unchanged.
The stats bar shows the total count of added and removed lines at a glance.
Options
Ignore Whitespace
When active, leading and trailing spaces and tabs are removed from each line before comparison. Two lines that differ only in indentation or trailing spaces are treated as equal. Enable this when comparing code that has been reformatted, or when text from different sources uses inconsistent spacing.
Ignore Case
When active, uppercase and lowercase letters are treated as the same character. “Hello” and “HELLO” are considered identical lines. Useful when comparing SQL queries written in different case conventions, or configuration files where key names may have been uppercased.
Word Diff
When active, the diff goes one level deeper: instead of only marking full lines as added or removed, it also highlights the specific words within a changed line that differ. This is helpful for spotting small edits inside long sentences — for example, a single noun that was replaced in a paragraph.
What the Myers Algorithm Does
The diff is computed using the Myers diff algorithm, introduced by Eugene Myers in 1986. It finds the shortest edit script — the fewest number of line insertions and deletions needed to transform text A into text B.
Internally, the algorithm works on a two-dimensional edit graph where each horizontal step represents deleting a line from text A, each vertical step represents inserting a line from text B, and diagonal steps represent matching equal lines. The algorithm finds the shortest path through this graph, which corresponds to the fewest edits.
This is the same algorithm used by Git, GNU diff, and most professional code review tools. It guarantees an optimal diff — no unnecessary edits are introduced.
Reading the Diff Output
| Color | Meaning |
|---|---|
| Green background | Line exists in the right panel (new text) but not in the left (original) |
| Red background | Line exists in the left panel (original) but not in the right (new text) |
| Gray / neutral | Line is the same in both texts |
Line numbers are shown on each side independently: the left column shows the line number in the original text, the right column shows the line number in the modified text. Removed lines show no right-side number; added lines show no left-side number.
Common Use Cases
Code review: Paste the old version of a function and the new version to see exactly what changed before committing.
Document editing: Compare two drafts of a document — a contract, a README, a specification — to audit all revisions.
Configuration files: Diff two config files to find which settings were added, removed, or changed between environments.
Data validation: Compare two exported CSV or JSON snippets to verify that a data transformation produced the expected output.
Translation review: Compare two translations side by side to find additions, omissions, or alterations in the translated text.
Privacy
All processing happens locally in your browser using JavaScript. The texts you paste are never transmitted to any server, logged, stored, or processed externally. Closing or refreshing the page clears both input panels completely.
Statistics
After each comparison, the tool reports:
- +N lines added — lines present in the new text but not in the original
- −N lines removed — lines present in the original but not in the new text
- N lines unchanged — lines identical in both texts
These counts reflect the raw line diff, not word or character counts. A single line that changed completely counts as one removal and one addition.