Free Diff Checker. Compare two texts or code snippets online for free. Highlight added, removed, and changed lines instantly with this free online diff checker.

Diff Checker

Compare two texts side-by-side with highlighted additions and deletions

Original
Modified

All processing happens in your browser. No data is sent to any server.

Key Features & Benefits

Line-by-Line Diff

Compare two texts line by line using the Longest Common Subsequence (LCS) algorithm. Added lines are highlighted in green, deleted lines in red, and unchanged lines appear normally with line numbers for easy reference.

Word-by-Word Diff

Compare texts at the word level to catch smaller changes within lines. This mode highlights individual word additions and deletions, making it ideal for editing and proofreading where line-level comparison is too coarse.

Diff Statistics Summary

See at-a-glance counts of added, deleted, and unchanged lines. The badge-style summary gives you an instant understanding of how much content changed between the two versions.

Swap Texts Instantly

One-click swap button to reverse the original and modified texts. This is useful when you want to see the diff from the opposite perspective — what was removed vs. what was added.

100% Client-Side Comparison

All diff computation runs in your browser using a JavaScript LCS implementation. No text is sent to any server, making it safe for comparing sensitive documents, code, and confidential content.

Diff Checker – Frequently Asked Questions

What algorithm does the diff checker use?
The diff checker uses the Longest Common Subsequence (LCS) algorithm to identify the longest matching sequence between two texts. This produces an optimal diff that shows the minimum set of changes needed to transform the original text into the modified text. It's the same fundamental approach used by Git's diff command.
What is the difference between line-by-line and word-by-word diff?
Line-by-line diff treats each line as a unit — if any part of a line changes, the entire line is marked as changed. Word-by-word diff breaks text into words and shows exactly which words were added or removed within a line. Use line diff for structural changes and word diff for detailed editing.
Can I compare very large texts?
The LCS algorithm has O(m×n) time complexity, where m and n are the number of lines or words. For texts up to several thousand lines, the comparison is instant. For very large files (tens of thousands of lines), there may be a brief delay but the tool will still work.
Is my text stored or sent anywhere?
No. All comparison logic runs entirely in your browser using JavaScript. Your text is never sent to any server, stored in any database, or accessible to anyone else. This makes it safe for comparing sensitive documents, confidential code, or private content.
What do the + and − symbols mean in the diff result?
The + symbol marks lines or words that exist in the modified text but not in the original (additions). The − symbol marks content that exists in the original but not in the modified text (deletions). Lines without a symbol are unchanged and appear in both versions.