iGuideSmart

Text Diff Compare

Compare two blocks of text or code locally using a Longest Common Subsequence (LCS) line diff highlighting additions and deletions.

+2 added · −1 removed
server: cloudflare-pages
− cache: 3600
+ cache: 86400
dark_mode: auto
+ compression: brotli
analytics: none

Formula & Calculation Logic

Computes the Longest Common Subsequence across lines of both documents to surface minimal, exact additions (+) and deletions (−) locally in-browser.

Primary Formula

LCS Dynamic Programming Matrix: O(M × N) Line Alignment

Example: Comparing two config files

  1. 1
    Split both inputs into lines
    Original (M lines) vs. Modified (N lines)
    LCS alignment table
  2. 2
    Emit unified diff
    + Added, − Removed, unchanged context
    Highlighted diff + stats

Unified Diff Symbol Legend

How additions, removals, and unchanged context lines are represented.

Showing 3 of 3 reference values
Diff output legend
MarkerMeaningColor Indicator
+Added in modified textGreen highlight
−Removed from original textRed highlight
(blank)Unchanged context lineNeutral surface

Practical Real-World Use Cases

Comparing Contracts, Prompts & Drafts

Spot subtle word or clause edits between two revisions instantaneously.

Reviewing .env & JSON Config Changes

Diff sensitive config snippets locally without pasting them into cloud services.

Text Diff Compare – Frequently Asked Questions

Can I ignore leading/trailing whitespace differences?
Yes—enable the "Ignore whitespace" toggle to focus purely on meaningful text changes.
Can I ignore case differences?
Yes—toggle "Ignore case" when comparing case-insensitive lists or SQL statements.
Is my compared text uploaded anywhere?
No. The LCS diff algorithm runs strictly inside your local browser memory.
View all Text & Writing Tools →