Compare two text files, articles, legal contracts, or source code snippets side-by-side in real time. Accurately detect added, deleted, and modified lines with 100% client-side privacy.
Paste text into both columns above, then click "Compare Differences".
Follow these four simple steps to compare text or code differences:
Paste the original version of your text or code in the left editor, or upload a local file directly.
Paste the modified version of your text or code into the right editor.
Choose between Side-by-Side or Unified view, select diff granularity, and toggle ignore whitespace/case.
Review color-coded additions (green), deletions (red), and changes (amber), then copy or download the patch.
How to extract text from binary rich documents before performing accurate character diffs.
Word files contain compressed XML and styling tags. To cleanly compare revisions:
PDFs lock visual coordinate layouts. To compare clauses and text changes:
pdftotext file.pdf output.txt.| Document Category | File Extensions | Direct Upload Status | Extraction Method | Diff Accuracy |
|---|---|---|---|---|
| Source Code & Scripts | .js, .ts, .php, .py, .html, .css, .sql, .go | Supported | Direct file upload or Copy-Paste | 100% Native |
| Plain Text & Prose | .txt, .md, .log, .csv, .env | Supported | Direct file upload or Copy-Paste | 100% Native |
| Configuration Data | .json, .yaml, .yml, .xml, .ini | Supported | Direct file upload or Copy-Paste | 100% Native |
| Microsoft Word | .docx, .doc | Extract First | Select All (Ctrl+A) > Copy > Paste text | Very High (Clean) |
| Adobe PDF | Extract First | Copy text from reader or pdftotext | Very High |
This tool implements the Longest Common Subsequence (LCS) computation and Myers Diff optimization algorithm (the same foundational algorithm powering git diff).
Mathematically, it computes the Shortest Edit Script required to transform Document A into Document B through three basic atomic operations:
| Feature | Side-by-Side View | Unified Diff View |
|---|---|---|
| Layout Structure | Dual adjacent columns (Left & Right) | Single sequential vertical stream |
| Best Use Case | Visual prose inspection, contracts, docs | Code pull requests, Git commit patches |
| Mobile Experience | Requires wide horizontal scrolling | Highly optimized for narrow screens |
| Standard Export | HTML visual view | Standard .diff / .patch file |
Windows uses \r\n while Linux/macOS uses \n. We automatically normalize line endings to prevent cross-OS false positive diffs.
Full multi-byte Unicode UTF-8 support ensures international accents, emojis, and non-Latin characters render without corruption or mojibake.
Regex patterns (\d+, (?<=...)) and HTML characters (<, >) are safely escaped to protect against XSS without altering syntax.
Inspect script changes in JavaScript, Python, PHP, Go, or SQL before pushing commits to Git.
Spot modified clauses or sneaky wording changes across legal contract drafts effortlessly.
Compare environment variables (.env), Nginx configs, and Docker Compose files across environments.
Yes, 100% private and secure. All text comparison algorithms run entirely within your web browser using client-side JavaScript. Your text is never transmitted over the internet or logged on any server.
To compare rich document formats like Word (.docx) or PDF, copy the text content (Ctrl+A then Ctrl+C) from your reader or export the file as Plain Text (.txt), then paste it into the respective editors for clean, noise-free text comparison.
Our tool natively supports all plain-text and source code files, including .txt, .js, .ts, .php, .py, .html, .css, .json, .md, .sql, .env, .yaml, .yml, .c, .cpp, .java, and .go.
The tool automatically normalizes all line breaks (CRLF \r\n, LF \n, and CR \r) into unified line breaks before running the diff algorithm, eliminating false positive differences caused by operating system mismatches.
The similarity percentage is calculated using the ratio of Longest Common Subsequence (LCS) characters to the total characters in both documents. 100% denotes identical texts, while 0% indicates zero overlapping characters.