Text Diff Checker
Compare two texts side-by-side. See additions, deletions, and unchanged content with color-coded highlighting.
Related Tools
How to Use
- Enter Two Texts — Paste the original text in the left panel and the modified version in the right panel. You can also type directly or use the Swap button to switch the panels.
- Choose Comparison Mode — Select Line-by-Line for structured comparisons (code, lists, documents) or Word-by-Word for prose and paragraph-level changes. Then click Compare.
- Review the Differences — Green highlights show additions, red shows deletions. The stats bar shows counts of added, removed, and unchanged elements plus a similarity percentage. Copy the diff output for reference.
About the Text Diff Checker
WritePadPro's Text Diff Checker compares two pieces of text and shows exactly what was added, removed, or left unchanged. It uses a Longest Common Subsequence (LCS) algorithm — the same mathematical foundation used by Git, Unix diff, and professional version control systems — to produce accurate, minimal diffs.
Two Comparison Modes
- Line-by-Line — Side-by-side panel view. The left panel shows the original text with deleted lines highlighted in red. The right panel shows the modified text with added lines highlighted in green. Unchanged lines appear in both panels without highlighting. Line numbers are displayed for easy reference. Panels scroll synchronously.
- Word-by-Word — Inline view. Both texts are merged into a single flow where removed words have a red background and added words have a green background. This is better for comparing prose, paragraphs, and continuous text where the changes are within lines rather than whole-line additions or deletions.
The LCS Algorithm
The diff uses dynamic programming to find the Longest Common Subsequence between the two input sequences. This determines the maximum set of elements that appear in both texts in the same order. Everything not in the LCS is either an addition (in the new text but not the old) or a deletion (in the old text but not the new). The algorithm runs in O(m*n) time where m and n are the lengths of the two sequences. For very large inputs (over 5 million cells), the tool automatically falls back to a simpler linear comparison to prevent browser freezing.
Use Cases
- Document revision — Compare your original draft with the edited version to see exactly what your editor changed
- Code review — Paste two versions of a code file to see what lines were added, removed, or modified
- Content auditing — Compare two web pages or articles to identify differences in wording or structure
- Contract review — Compare contract versions to identify changed clauses or terms
- Translation checking — Compare source and back-translated text to verify accuracy
- Student work — Compare student submissions to identify similarities (see also our Text Similarity Checker)
Similarity Score
The tool calculates a similarity percentage based on the ratio of unchanged elements to total elements. This gives you a quick quantitative measure of how different two texts are. Combined with the visual diff highlighting, you get both a bird's-eye view (the percentage) and a detailed view (the colored highlights) of the changes.
Privacy
The LCS algorithm runs entirely in your browser using JavaScript. Both texts stay on your device — they are never transmitted to any server, stored in any database, or processed by any external service. This makes the tool safe for comparing confidential business documents, legal contracts, proprietary code, and any other sensitive content.
Frequently Asked Questions
What is the difference between line and word mode?
Line-by-Line mode compares texts line by line in a side-by-side view — left panel shows the original with removed lines in red, right panel shows the modified with added lines in green. Word-by-Word mode compares individual words in an inline view — removed words appear with red background, added words with green background, within a single flowing text. Use line mode for code and structured text, word mode for prose.
What algorithm does the diff use?
The tool uses a Longest Common Subsequence (LCS) algorithm — the same foundational approach used by Unix diff, Git, and other professional diff tools. It builds a dynamic programming table to find the optimal alignment between the two texts, then backtraces to produce the minimal diff. For very large texts (over 5 million comparison cells), it falls back to a simpler linear comparison to prevent browser slowdown.
What does the similarity percentage mean?
Similarity is calculated as: unchanged elements / total elements * 100. If two texts share 80% of their lines (or words in word mode), the similarity is 80%. A score of 100% means the texts are identical. A score near 0% means they are completely different.
Can I compare code with this tool?
Yes. Line-by-Line mode is ideal for comparing code — each line is compared independently, and additions/deletions are clearly marked. The side-by-side view with line numbers makes it easy to identify exactly what changed between two versions of code. However, this is a text-level diff, not a syntax-aware diff — it does not understand programming language structure.
Does the side-by-side view scroll together?
Yes. In line-by-line mode, the left and right panels are scroll-synced. When you scroll one panel, the other scrolls to the same position, keeping the compared lines aligned. This makes it easy to review long documents without losing your place.
Is my text sent to a server?
No. The entire comparison runs in your browser using JavaScript. The LCS algorithm processes your texts locally — nothing is transmitted to any server. This is safe for comparing confidential documents, proprietary code, private drafts, and sensitive content.