Diff / Text Compare
Compare two text blocks side by side and highlight differences instantly.
Advanced — Unified · Full context · Exact match
What is Diff / Text Compare?
A diff tool highlights the differences between two versions of text. Paste your original content in one panel and the modified version in the other; the tool instantly shows what was added, removed, or changed. This is essential for comparing code versions, config files, legal documents, or any text where you need to see exactly what changed.
The tool offers two output modes: Unified (classic - and + line prefixes) and Inline (word-level highlighting within changed lines). Auto-compare runs as you type, so you see updates in real time. Use Swap to exchange the two panels without copy-pasting, and Save to download the diff as a standard .patch file for version control or code review.
Common use cases include comparing drafts before and after edits, verifying config changes before deployment, reviewing code snippets or JSON payloads, and auditing document revisions. The comparison runs entirely in your browser — your text is never uploaded or stored.
How to Use Diff / Text Compare
- Paste the original text into the left panel (Original).
- Paste the modified text into the right panel (Modified).
- Differences are highlighted automatically. Click Compare to refresh if needed (or press Ctrl+Enter).
- Toggle between Unified and Inline in Advanced to switch between line-level and word-level diff views.
- Use Swap to exchange the two texts. Click Save to download the diff as a .patch file.
Tips & Best Practices
Enable Ignore whitespace when comparing code or configs where indentation or trailing spaces differ but content is the same. Use Ignore case when comparing text where capitalization is irrelevant. Set Context lines to a small number (e.g., 3) to collapse unchanged sections and focus on the changed regions — set to 0 to show full context.
For large files, paste only the relevant sections to keep the diff readable. The inline mode is especially useful when single lines have many changes — it highlights added and removed words within each line. Pair with the Case Converter to normalize text before comparing if case differences are noise.
When to Use This Tool
Use Diff / Text Compare when reviewing code or config changes, comparing document drafts, auditing before/after edits, or generating patch files for version control. For formatting or transforming text before comparison, use the Case Converter. For creating URL-friendly slugs from titles, try the Slug Generator. For structured data, the JSON Formatter can help normalize JSON before diffing.
Frequently Asked Questions
What is a diff?
A diff shows the differences between two versions of text. Lines marked with - were removed, lines marked with + were added.
How do I read the diff output?
Lines prefixed with - (in red) were in the original but removed. Lines prefixed with + (in green) were added in the modified version. Unchanged lines have no prefix.
Is my text sent to a server?
No. The diff tool runs entirely in your browser. Your text is never uploaded or stored.
Can I compare code or config files?
Yes. Paste the original in the left panel and the modified version in the right. Click Compare for a line-by-line diff. Use Swap to exchange the two texts. You can also use the case converter to normalize text before comparing.
What is the Swap button for?
Swap exchanges the two text blocks so you can quickly compare in the opposite direction without copy-pasting.