Frequently Asked Questions
How does the text diff tool work?
The tool uses a longest common subsequence (LCS) algorithm to find what is common between the two texts. Lines/words unique to text A are highlighted in red (removed), lines/words unique to text B are in green (added).
What's the difference between line diff and word diff?
Line diff shows which entire lines were added, removed, or changed. Word diff breaks each line into words and shows which specific words changed. Character diff is the most granular — it shows individual characters that changed.
Can I compare code with this tool?
Yes! The diff tool works well for comparing code. Use "Line by Line" mode for code comparisons. For code, you may want to keep "Case Sensitive" set to Yes.
Is my text uploaded to a server?
No, the comparison runs entirely in your browser using JavaScript. Neither text you paste in is sent anywhere, which makes it safe to compare confidential drafts or private content.
What does the color coding mean?
Content shown in red represents text that exists in the first (original) input but not the second, meaning it was removed. Content shown in green represents text in the second input that wasn't in the first, meaning it was added.
How large a text can I compare?
The tool handles typical documents, articles, and code files well. Very large files (tens of thousands of lines) may take a moment longer to process since comparison runs in your browser rather than on a server.
About the Text Diff Tool
The Logrith Text Diff tool compares two blocks of text and highlights exactly what changed between them — additions in green, removals in red — so you can spot differences instantly instead of reading through both versions line by line looking for discrepancies. It supports comparison at the line, word, or character level, and works entirely in your browser.
Comparing two versions of text comes up constantly: checking what changed between two drafts of a document, reviewing edits a collaborator made, comparing two versions of code before merging, or verifying that a copied block of text matches the original exactly. Doing this manually by reading both versions side by side is slow and error-prone, especially with longer text, which is exactly the problem this tool solves.
Three Levels of Comparison
- Line by Line. Compares entire lines at once, showing which lines were added, removed, or changed. This is the most useful mode for comparing code, configuration files, or any text organized into discrete lines.
- Word by Word. Breaks each line down into individual words and highlights exactly which words changed within a line, useful for catching small edits in prose that a line-level diff would mark as an entire line changing.
- Character by Character. The most granular mode, highlighting individual characters that differ — useful for catching typos, punctuation changes, or very small edits that word-level comparison might group together.
How the Comparison Algorithm Works
This tool uses a longest common subsequence (LCS) algorithm, a well-established approach to text comparison that also powers version control tools like Git's diff feature. Rather than naively comparing text position by position — which breaks down the moment anything is inserted or deleted partway through, shifting everything after it out of alignment — LCS finds the longest sequence of matching content shared between the two texts, then treats everything outside that shared sequence as either an addition or a removal. This is why inserting a single new line in the middle of a document doesn't cause the diff tool to mark every subsequent line as changed; it correctly identifies that only the new line is different and everything else still matches.
Common Use Cases for Text Diffing
- Reviewing document edits. Quickly see what a collaborator or editor changed in a shared document without manually comparing two long files.
- Comparing code snippets. Check differences between two versions of a function or configuration file, especially useful when working outside a version control system.
- Verifying copied text. Confirm that a block of text was copied exactly, with no accidental changes, truncation, or formatting differences introduced.
- Tracking content changes over time. Compare an older saved version of an article or policy document against the current version to see exactly what's been updated.
- Catching subtle errors. Spot small but important differences, like a changed number or date, that are easy to miss when scanning text by eye.
Case Sensitivity and Why It Matters
The case-sensitive toggle controls whether "Hello" and "hello" are treated as identical or different during comparison. For most natural-language prose comparison, keeping case sensitivity off can reduce noise from inconsequential capitalization differences. For code comparison, however, case sensitivity usually should stay on, since many programming languages treat identifiers, variable names, and keywords as case-sensitive — a difference between myVariable and myvariable could represent an actual bug, not just a stylistic variation.
Step-by-Step: How to Compare Two Texts
Privacy
Both text inputs are processed entirely within your browser using JavaScript — nothing is uploaded to a server, logged, or stored anywhere. This makes the tool a safe choice for comparing confidential documents, private drafts, or proprietary code without that content ever leaving your device.