Common questions about how text diffing works, what the colour coding means, performance limits, and privacy
What is a text diff checker and how does it work?
A text diff checker is a tool that compares two pieces of text and highlights exactly what changed between them -- which lines were added, which were removed, and which remained identical. This tool uses the Longest Common Subsequence (LCS) algorithm, the same approach used by the Unix diff command and Git version control. LCS finds the largest set of lines that appear in the same relative order in both texts. Lines not in that common set are classified as either added (present only in the right/modified text) or removed (present only in the left/original text). The result is the minimal set of changes needed to transform one text into the other, displayed with colour-coded highlighting.
What is the LCS algorithm and why is it used for text comparison?
The Longest Common Subsequence (LCS) algorithm solves the problem of finding the longest sequence of elements that appear in the same order in both input sequences -- without requiring the elements to be contiguous. For text diffing, the elements are lines of text. LCS is preferred over simpler character-by-character comparison because it produces semantically meaningful diffs: it correctly identifies blocks of unchanged lines even when surrounding content has shifted due to insertions or deletions elsewhere. The classic Unix diff tool, GNU diff, and Git's diff engine all use variants of LCS with optimisations for large files. This browser-based implementation uses a dynamic programming approach with an O(n*m) space complexity, which works efficiently for typical document and code comparison tasks.
What is the difference between unified view and split view in a diff checker?
Unified view (also called inline view) displays both the original and modified text in a single vertical stream. Removed lines (marked with a red minus prefix) and added lines (marked with a green plus prefix) appear interleaved, showing the context of each change in sequence. This is the format used by git diff in the terminal and is most efficient for reading when changes are sparse and spread throughout a long document. Split view (also called side-by-side view) displays the original text in the left column and the modified text in the right column simultaneously. Removed lines appear only in the left column and added lines only in the right column, making it visually easy to compare corresponding sections. Split view is better for understanding what replaced what when blocks of text have been rewritten.
Can I use this text diff tool to compare code files?
Yes -- this diff checker is well suited for comparing any plain text content including source code in any programming language, configuration files (JSON, YAML, TOML, .env), SQL scripts, shell scripts, Markdown documents, HTML/CSS, and any other text-based format. The comparison is line-level, meaning it identifies which lines changed rather than which individual characters within a line changed. This mirrors how developers use git diff during code review. For most code comparison tasks, line-level diff is sufficient to understand what was added, removed, or modified between two versions. The dark-themed monospace output panel uses JetBrains Mono font for clear code readability.
Is my text sent to a server when I use this diff checker?
No -- all text comparison processing runs entirely within your browser using JavaScript. When you click Compare, the LCS algorithm executes locally on your device and the results are rendered directly in the page. No text content is transmitted to any server, logged, or stored anywhere. This makes the tool safe to use with sensitive content such as internal documents, proprietary source code, confidential contracts, personal data, and anything else you would not want to send to a third-party service. The tool has no backend infrastructure -- it is a pure client-side React component. You can verify this by checking your browser's network tab while running a comparison: no outbound requests are made.
How do I compare two versions of a document for changes?
To compare two document versions, paste your original text into the left textarea labelled 'Original' and paste the revised version into the right textarea labelled 'Modified'. Click the Compare button to run the diff analysis. The tool will display added lines highlighted in green with a plus prefix, removed lines in red with a minus prefix, and unchanged lines in the default dark theme. Use the Unified View for a scrollable single-column output or Split View to see both versions side by side. The stats bar shows a summary count of added, removed, and unchanged lines. For documents pasted from word processors, ensure any special formatting or smart quotes are preserved as plain text -- the diff comparison is purely text-based and does not interpret rich text formatting.
Can I use this diff tool to check for plagiarism or content copying?
This text diff checker can help identify whether one document contains copied or paraphrased content from another by showing the percentage of unchanged lines between them. If you paste two texts and the diff shows a high number of equal (unchanged) lines, that indicates significant overlap. However, it is not a plagiarism detection tool in the traditional sense -- it does not search the web for matching content, does not handle paraphrasing (where words are changed but meaning is preserved), and does not work across multiple documents simultaneously. For academic plagiarism detection, dedicated tools like Turnitin or Copyscape are more appropriate. This tool is best used for comparing two specific known texts -- for example, checking whether a contractor's deliverable matches a prior work, or verifying that a republished article matches your original.
What types of text content work best with a line-by-line diff checker?
Line-by-line diff works best for content with meaningful line boundaries: source code (where each statement typically occupies one line), configuration files, CSV data, lists of items, legal contracts and formal documents with clause-per-line structure, Markdown files, email templates, and shell scripts. It is less effective for dense prose paragraphs where a single sentence might span multiple lines or where a small change in a word forces the entire paragraph to reflow across different line breaks -- in those cases, most unchanged text may appear as removed and added because the line boundaries shifted. For prose comparison, reformatting both inputs to have one sentence per line before comparing produces much cleaner and more readable diff output.
How do I interpret the diff stats -- added, removed, and unchanged counts?
The stats bar displayed after running a comparison shows three counts. Added (green) is the number of lines present in the right/modified text but not in the left/original -- these are new lines inserted into the document. Removed (red) is the number of lines present in the left/original text but not in the right/modified -- these are lines that were deleted. Unchanged (purple) is the number of lines identical in both texts -- these form the common backbone identified by the LCS algorithm. Note that a single edit that rewrites a line produces one removed count and one added count, not an in-place modification, because the diff operates at the line level. To calculate the overall change percentage: divide (added + removed) by (added + removed + unchanged) and multiply by 100.
What is the maximum text size this diff tool can handle?
This browser-based diff tool uses a dynamic programming LCS implementation with O(n*m) time and space complexity, where n and m are the line counts of the two input texts. In practice this means: very small texts (under 500 lines each) produce results instantaneously, medium texts (500-2000 lines) run in under a second on modern devices, and large texts (2000-5000 lines each) may take 2-5 seconds. For very large files above 5000 lines, the browser tab may become slow or unresponsive during computation. If you need to diff large files, consider splitting them into smaller sections and comparing segment by segment, or using a desktop diff tool like VS Code's built-in diff editor, Meld, or Beyond Compare which are optimised for large file comparison with memory-efficient diff algorithms.