Text Diff
Compare Two Texts Side by Side
Paste or upload two texts and instantly see every difference highlighted — line by line and character by character. Everything runs in your browser, nothing is uploaded.
What Is a Text Diff Tool?
A text diff tool compares two pieces of text and highlights every difference between them. It works line by line, marking lines that were added, removed, or changed. When a line has been modified rather than fully replaced, character-level highlighting pinpoints the exact characters that differ — so you can spot a single typo in a long line without reading every character.
Our Text Diff tool uses a Longest Common Subsequence (LCS) algorithm to produce accurate, minimal diffs. Paste text directly, upload files, toggle whitespace and case sensitivity options, and view results in three modes: side by side, unified, or inline.
The side-by-side view places the original and modified texts in two aligned columns with line numbers, making it easy to scan through a document and see exactly where changes occur. The unified view shows a single column with minus and plus prefixes, just like a git diff or patch file. The inline view merges both texts with strikethrough for removals and highlights for additions.
Everything runs entirely in your browser — no data is sent to any server. The tool is ideal for comparing code, configuration files, contracts, essays, API responses, and any other text. Close the tab and nothing remains.
Discover Features
Line-level and character-level diffs, multiple view modes, file upload, comparison options, and full privacy — all on your device
Side-by-Side Comparison
View the original and modified texts in two aligned columns with line numbers. Removed lines are highlighted in red on the left, added lines in green on the right — making changes instantly visible.
Character-Level Diffs
When a line is changed rather than simply added or removed, the tool highlights the exact characters that differ within the line. Quickly spot a single typo in a long line without reading every character.
Multiple View Modes
Choose from three display modes: Side-by-Side for parallel comparison, Unified for a single-column patch-style view, or Inline for merged text with strikethrough removals and highlighted additions.
File Upload Support
Upload .txt, .md, .json, .xml, .csv, .html, .css, .js, and many more file types directly into either input. No size limits beyond your browser memory — compare entire configuration files or source code.
Comparison Options
Toggle ignore-whitespace to skip indentation and trailing-space differences. Enable case-insensitive mode to treat uppercase and lowercase as equal. Focus on the changes that actually matter.
100% Private & Secure
All diffing runs entirely in your browser using JavaScript. Nothing is sent to any server. Your texts never leave your device — close the tab and nothing remains. Perfect for comparing sensitive documents.
How to Use
Four steps: paste texts, set options, compare, and review the highlighted differences
Paste or upload texts
Enter the original text in the left textarea and the modified text in the right textarea. You can also click 'Upload file' to load content from a file.
Set comparison options
Toggle 'Ignore whitespace' to skip indentation differences or 'Case insensitive' to treat upper/lowercase equally. Both options are optional.
Click Compare
Hit the Compare button. The tool computes line-level and character-level diffs using the LCS algorithm and displays the results below.
Review and copy
Switch between Side-by-Side, Unified, and Inline views. Use the 'Copy Diff' button to copy the unified diff to your clipboard for sharing or patching.
Use Cases
Common scenarios where comparing two texts saves time and prevents mistakes
Code Review
Compare two versions of a source file to see exactly what changed between commits, branches, or pull requests — without leaving your browser.
Document Proofreading
Spot edits, corrections, and rewrites in contracts, essays, or articles by comparing the draft and final versions side by side.
Configuration Debugging
Compare working and broken config files (JSON, YAML, TOML, .env) to pinpoint the exact line or value that introduced a bug.
Translation Comparison
Place the original and translated text side by side to verify that every paragraph and sentence has been translated without accidental omissions.
Database Migration Scripts
Diff two versions of SQL migration scripts to ensure only intended schema changes are applied before running in production.
API Response Comparison
Compare JSON or XML responses from different API endpoints, environments, or time periods to identify data discrepancies and regressions.
Free vs Paid — Text Diff
Get started free, upgrade when you need more power.
Unlock the Full Power of Text Diff
Remove daily limits, process larger files up to 500 MB, enable batch processing, and get priority support.
Developer Tools includes:
- 13 developer & utility tools
- Unlimited daily uses
- No file size limits
- All output formats
Also available in the All Tools Bundle
FAQ
Frequently asked questions about the Text Diff tool
Q1. What diff algorithm does this tool use?
Q2. Is my data safe?
Q3. What file types can I upload?
Q4. What does 'Ignore whitespace' do?
Q5. What does 'Case insensitive' do?
Q6. What is the difference between the three view modes?
Q7. How is the similarity percentage calculated?
Q8. Can I compare very large files?
Related Tools
Compare texts, then try these other utility tools