Free Diff Checker
Paste an original and a changed version to compare them line by line. The tool highlights added, removed, and unchanged lines and reports the totals.
Quick answer
Paste your original text on the left and the changed text on the right. This diff checker runs a longest-common-subsequence (LCS) line comparison in your browser, marking each line as added (+), removed (-), or unchanged, and shows how many of each there are.
Formula & method
Line classification
unchanged = lines in the LCS of original and changed; removed = original line not in LCS (prefix -); added = changed line not in LCS (prefix +)
- LCS — longest common subsequence of the two line sequences, preserving order
- + — prefix marking a line present only in the changed text (added)
- - — prefix marking a line present only in the original text (removed)
With ignore-case or trim enabled, lines are matched on a normalized key (lowercased and/or trimmed), but the displayed text stays as written.
The two texts are split into lines. A longest-common-subsequence (LCS) algorithm finds the largest set of lines that appear, in order, in both versions; those lines are marked "unchanged." Lines that exist only in the original are marked "removed" (prefixed with -), and lines that exist only in the changed text are marked "added" (prefixed with +). Walking the LCS table from top to bottom produces a unified, in-order diff and a count of added, removed, and unchanged lines. Optional "ignore case" and "trim spaces" settings only affect how lines are matched — the original line text is always preserved in the output. Everything is computed locally in your browser, so nothing is uploaded.
Examples
- Input
- Original: apple banana cherry Changed: apple blueberry cherry
- Result
- apple - banana + blueberry cherry (1 added, 1 removed, 2 unchanged)
- Why
- "apple" and "cherry" are in both, so they are unchanged. "banana" only exists in the original (removed) and "blueberry" only in the changed text (added).
- Input
- Original: one two three Changed: one two three four
- Result
- one two three + four (1 added, 0 removed, 3 unchanged)
- Why
- The first three lines match exactly, so only the new final line "four" is reported as added.
- Input
- Original: cat dog bird Changed: dog bird
- Result
- - cat dog bird (0 added, 1 removed, 2 unchanged)
- Why
- "dog" and "bird" still appear in order in both versions. "cat" was dropped, so it is marked removed.
- Input
- Original: hello world Changed: hello world
- Result
- hello world (0 added, 0 removed, 2 unchanged)
- Why
- Both blocks are the same, so every line is part of the common subsequence and nothing is added or removed.
When to use this tool
- Comparing two versions of a config file, email draft, or document to see exactly what changed.
- Reviewing edits to a list of items, URLs, or log lines before applying them.
- Checking that a copy-paste or migration kept every line intact, without sending the text to a server.
Common mistakes
- Expecting a word-level or character-level diff. This tool compares whole lines, so a small edit inside a line shows up as one removed line plus one added line.
- Treating differently indented or trailing-space lines as identical. Enable "trim spaces" if leading or trailing whitespace should be ignored when matching.
- Forgetting that capitalization matters by default. Turn on "ignore case" if "Hello" and "hello" should count as the same line.
Frequently asked questions
How does this diff checker decide what changed?
It uses a longest-common-subsequence (LCS) algorithm on the lines of both texts. Lines that appear in the same order in both versions are "unchanged," lines only in the original are "removed," and lines only in the changed text are "added."
Does it compare line by line or word by word?
It compares whole lines. If you edit a few words inside a line, that line is reported as one removed line and one added line rather than a partial change.
What do the + and - symbols mean?
A leading "+ " marks a line that was added (present only in the changed text) and a leading "- " marks a line that was removed (present only in the original). Unchanged lines have no marker. This matches the convention used by Git and unified diffs.
Can it ignore capitalization or extra spaces?
Yes. "Ignore case" matches lines regardless of upper/lowercase, and "trim spaces" ignores leading and trailing whitespace when matching. Both options only affect matching; the output keeps your original line text.
Is my text uploaded anywhere?
No. The entire comparison runs in your browser with JavaScript, so both blocks of text stay on your device and nothing is sent to a server.
Can I copy the diff result?
Yes. The result panel includes a copy button that copies the full unified diff, with + and - prefixes, so you can paste it into a message, ticket, or document.
Does the order of lines matter?
Yes. Because it uses a subsequence match, lines must appear in the same relative order to count as unchanged. Re-ordering blocks of text will show some lines as removed and re-added.
Sources & references
External references open in a new tab. We are independent and not affiliated with these organizations.
- ✓ Free to use
- ✓ No sign-up required
- ✓ Runs entirely in your browser — nothing is uploaded.
- ✓ Formula and method shown above
Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.
Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.
Related tools
Embed this tool on your site
Free to embed, no sign-up. Paste this code where you want the diff checker text compare to appear: