TEXT · COMPARE
Text Diff Checker & Text Comparison Tool
Compare two text files, contract revisions, code snippets, or draft paragraphs side by side. Instantly highlight additions, deletions, and inline modifications with complete client-side confidentiality.
About Text Diff Checker & Text Comparison Tool
Compare two text files, contract revisions, code snippets, or draft paragraphs side by side. Instantly highlight additions, deletions, and inline modifications with complete client-side confidentiality.
How to use
- Paste original text: Paste your initial text or baseline document into the left "Original" panel.
- Paste revised text: Paste the updated version or modified draft into the right "New Version" panel.
- Run comparison: Click "Compare text" to trigger the difference analysis (or observe real-time updates as you type).
- Review highlights: Green lines marked with a plus (+) indicate additions; red lines marked with a minus (-) indicate removals.
- Copy or swap: Use the "⇄ Swap" button to reverse original and modified texts, or click "Copy diff" to copy the patch.
Longest Common Subsequence (LCS) Diff Algorithm
LCS(i, j) = LCS(i-1, j-1) + 1 if A[i] == B[j] else max(LCS(i-1, j), LCS(i, j-1))Text comparison relies on the Longest Common Subsequence (LCS) algorithm using dynamic programming. By identifying lines that exist in both files in identical relative order, the algorithm isolates content that was inserted into the revised text or removed from the baseline original, producing standard unified diff formatting.
Examples
Example 1: Editorial Paragraph Revision & Proofreading
Proofreading an opening homepage sentence to elevate tone and emphasize privacy features.
- Original Baseline (-)
- - Layerlee is a simple website with basic tools for students.
- Revised Output (+)
- + Layerlee provides calm, high-precision, offline-ready tools for professionals.
- Lines Altered
- 1 deletion, 1 addition, 0 unchanged lines
Example 2: Software Configuration & Environment Settings
Spotting configuration port updates and cache lifetime changes between staging and production config files.
- Original Config (-)
- - DATABASE_PORT=5432 - CACHE_TTL_SECONDS=300
- Modified Config (+)
- + DATABASE_PORT=5433 + CACHE_TTL_SECONDS=3600 + ENABLE_QUERY_LOGGING=true
- Lines Altered
- 2 modified settings, 1 new configuration line
Real-world use cases
- Legal Contracts & Agreement Reviews: Audit redlines and revisions between vendor contract versions to ensure no hidden clauses were altered.
- Content Editing & Proofreading: Inspect editorial changes made by co-authors, editors, or AI writing assistants.
- Code & Script Comparison: Compare SQL queries, JSON schemas, environment variables, or script updates quickly without opening a terminal.
- Academic Essay Revisions: Track iterations between draft outlines and final university submissions.
Important notes & limitations
- Line-Oriented Processing: Comparisons are conducted on a line-by-line basis; wrapping an entire document into one long line reduces diff clarity.
- 100% Client-Side Privacy: Your proprietary contracts, code, and confidential documents never leave your browser memory.
Frequently asked questions
Are my confidential documents uploaded to an external server?
No. The entire comparison algorithm runs locally inside your web browser’s JavaScript engine. No text, analytics, or files are ever transmitted across the internet.
What is the difference between side-by-side and inline view?
Side-by-side view splits the screen into two parallel columns comparing baseline and revised texts horizontally. Inline view weaves both texts into a single vertical stream, which is ideal for smartphone screens.
Can this tool compare code or JSON files?
Yes. It compares any plain text, including JSON files, YAML configuration, Python/JavaScript code, CSV datasets, and markdown documents.
How do I invert the comparison?
Click the "⇄ Swap" button in the workbench controls to instantly swap the left and right text boxes.