Private Text Diff Checker

Compare two text or code blocks 100% locally in your browser with line-level and word-level inline diffing, side-by-side and unified views, and zero server uploads.

Differences detected between Original (A) and Modified (B).
+ Added Lines+3
− Removed Lines−2
= Unchanged Lines2
Words (+Added / −Removed)+7 / −4

Line & Word Comparison Output

#Original (A)#Modified (B)
1=Project: PeekAndDo Utilities1=Project: PeekAndDo Utilities
2−Payment is due within 30 calendar days of invoice date.2+Payment is due within 15 business days of invoice receipt.
3−Server port: 80803+Server port: 9090
4=Mode: staging4=Mode: staging
5+Strict Privacy: enabled
100% Local Browser Privacy Guarantee: All text comparison runs strictly in your browser's local memory (up to 100,000 characters or 2,500 lines per panel). Neither panel is ever uploaded to a server, logged, or stored in localStorage, sessionStorage, or cookies.

LCS Diff Methodology & 100% Client-Side Privacy Architecture

A text diff checker computes the Shortest Edit Script (SES) and Longest Common Subsequence (LCS) between an Original text (Panel A) and a Modified text (Panel B) to identify added (+), removed (−), and unchanged (=) lines and inline word edits—100% locally inside your browser without uploading sensitive content to any server.

First, Windows CRLF (\r\n) and legacy CR (\r) line endings are normalized to standard LF (\n). Common unchanged prefix and suffix lines are stripped in O(N) time, and dynamic programming Longest Common Subsequence (LCS) alignment is computed across the changed window. Contiguous removed and added line blocks are paired so a secondary token-level LCS pass can highlight exact inline word insertions (<ins>) and deletions (<del>).

Technical Assumptions & Privacy Safeguards

  • All diff computation runs 100% client-side in volatile browser memory; zero data is sent over the network or written to localStorage, sessionStorage, or cookies.
  • Line endings are normalized (\r\n → \n) prior to comparison so cross-platform copy-paste does not trigger false full-document diffs.
  • When 'Ignore Whitespace' is enabled, leading/trailing spaces are trimmed and multiple horizontal spaces or tabs are collapsed to a single space before comparison.
  • Inputs are bounded to 100,000 characters and 2,500 lines per panel to guarantee responsive main-thread UI performance.

Verified Worked Examples

Example 1: Contract Clause Revision with Inline Word Diff

Original (A): 'Payment is due within 30 calendar days of invoice date.' vs. Modified (B): 'Payment is due within 15 business days of invoice receipt.'

1 modified line pair detected: '30 calendar' and 'date.' marked as removed (− <del>), '15 business' and 'receipt.' marked as added (+ <ins>).

Example 2: Configuration Comparison with 'Ignore Whitespace' Enabled

Comparing two JSON/YAML snippets where one uses 2-space indentation and the other uses 4-space indentation, plus one changed port number (8080 → 9090).

With 'Ignore Whitespace' enabled, all indentation-only lines are marked Unchanged (=), isolating only the single line where 8080 changed to 9090.

Frequently Asked Questions (FAQ)

Is it safe to compare confidential text, contracts, or configuration files here?

Yes. PeekAndDo's Private Text Diff Checker executes 100% locally inside your web browser using client-side JavaScript. Your text never leaves your device, is never transmitted to any API or server, and is never persisted in localStorage, sessionStorage, or cookies.

How does a text diff algorithm find the minimal differences between two texts?

Diff tools solve the Longest Common Subsequence (LCS) problem—closely related to Eugene Myers' O(ND) difference algorithm (1986). By finding the longest sequence of lines (and words within modified lines) that appear in both Panel A and Panel B in the same relative order, the engine isolates only the minimal insertions (+) and deletions (−) required to transform Text A into Text B.

What is the difference between Side-by-Side View and Unified View?

Side-by-Side (Split) View places Original lines on the left and Modified lines on the right so you can read corresponding revisions across two columns. Unified View stacks removed lines (−) and added lines (+) in a single vertical stream—the same format used by `git diff` and standard software patch files.

Why do two identical-looking files sometimes show every line as changed in other tools?

Often one text uses Windows line endings (CRLF, `\r\n`) while the other uses Unix/macOS line endings (LF, `\n`), or one has trailing spaces at the end of lines. PeekAndDo automatically normalizes `\r\n` to `\n` and provides an 'Ignore Whitespace' toggle so formatting noise does not obscure real content changes.