How It Works Under the Hood
The engine splits both inputs into normalized lines, runs a Longest Common Subsequence (LCS) dynamic-programming matrix (falling back gracefully to hashed chunk matching for large inputs), marks unchanged, added, and removed lines, and computes token-level inline word deltas on adjacent modifications.
Step-by-Step Instructions
Paste or load your Original (left) text and Modified (right) text into the dual editors.
Toggle optional normalization rules such as Ignore Trailing Whitespace or Case-Insensitive matching before comparing.
Inspect side-by-side or inline word-level additions (green) and deletions (red) along with summary addition/deletion line counts.
Copy or download the standard unified diff (`.patch`) output for `git apply` or code review documentation.
Key Features & Performance
- Pure browser-RAM diffing — safe for proprietary source code, `.env` configs, and NDA drafts
- Dual Line Diff and Inline Word-Level token highlighting
- Configurable whitespace trimming and case-sensitivity options
- Unified `.patch` header generation (`--- original`, `+++ modified`, `@@` hunks)
- One-click Swap Left/Right and instant Clear controls
Methodology, Formulas & Technical Standards
Line diffs follow Longest Common Subsequence (LCS) alignment over newline-normalized strings (`\r\n` normalized to `\n`). Unified patch hunks group consecutive changes with standard 3-line context headers (`@@ -start,count +start,count @@`).
Common Real-World Use Cases
- Reviewing edits between two versions of an Apache/Nginx config or `.env.example` before deployment
- Comparing contract paragraphs or Terms of Service revisions without sending confidential drafts to third-party diff sites
- Generating quick unified `.patch` files for bug reports or pull-request discussions
- Auditing generated SQL migrations or API JSON payloads line-by-line
Worked Examples & Edge Cases
Configuration Port Change
Left: port=8080\nmode=dev | Right: port=8443\nmode=production
@@ -1,2 +1,2 @@\n-port=8080\n-mode=dev\n+port=8443\n+mode=production
Adjacent modified lines are grouped in one unified hunk while preserving exact line numbers.
Trailing Whitespace Normalization
Left: "timeout = 30 " | Right: "timeout = 30"
0 differences when "Ignore trailing whitespace" is enabled
Eliminates noisy diffs caused by editor auto-formatting.
Limitations, Scope & Accuracy Notes
- • Extremely large files (tens of thousands of completely distinct lines) consume quadratic memory in exact LCS matching; split multi-megabyte logs before diffing.
- • Performs plain-text character/line diffing rather than AST-aware semantic diffing for binary or compiled formats.
Local Browser Processing & Privacy
Traditional web converters upload your documents, snippets, or media files to remote servers. Text Diff Checker & Patch Generator runs inside your browser tab:
Your input text and files are processed locally without uploading payloads to a processing server.
Microdeck does not log or store the files or inputs you paste into tool workspaces (normal static hosting/CDN requests still load page assets).
Working outputs stay in your browser tab and are released when you reset the tool or close the tab.
Frequently Asked Questions
Does this diff tool upload my code or contracts?
No. Every comparison runs synchronously in JavaScript inside your browser tab with zero network transmission.
Can I apply the exported .patch output with Git?
Yes, for single-file text comparisons the generated unified diff follows standard hunk headers recognized by `patch` and `git apply` when matching target filenames.
What is the difference between Line Diff and Word Diff?
Line Diff compares entire lines, while Word Diff breaks changed lines into whitespace and word tokens so you can immediately spot a single changed variable or typo.
Are Windows CRLF and Unix LF line endings treated as differences?
Carriage returns (`\r\n`) are normalized internally before line splitting so cross-OS copy/pastes do not mark every line as modified.
Explore Related Micro-Tools
JSON Formatter, Validator & Diff
Format, validate, compare diffs & auto-repair malformed JSON locally in your browser
Line List Cleaner, Deduplicator & Set Comparator
Deduplicate, trim, sort cleanly (numeric/natural/shuffle), wrap items, or run A∩B / A−B set math
Unicode Inspector & Hidden Character Sanitizer
Detect invisible zero-width characters, Trojan Source BiDi overrides & homoglyphs + NFC/NFD normalize