How to Compare Text with a Unified Diff
Text Diff
When to Use Text Diff
Compare config snippets, log excerpts, API responses, or any two text blocks to see exactly which lines were added or removed — without installing a desktop diff tool. Paste original text in the first panel and modified text in the second.
Reading the Output
- Lines prefixed with
-were removed from the original. - Lines prefixed with
+were added in the modified version. - Unchanged lines appear without a prefix.
Common Mistakes
- Trailing whitespace causing false line differences
- Expecting word-level highlighting — this is a line-level diff
- Different line endings (CRLF vs LF, or classic Mac CR) showing entire file as changed — normalize first if needed
Developer Tips
- Normalize whitespace before diffing if formatting noise is not important
- Use JSON Diff for structured API response comparison
- Copy unified diff output into code review comments
Frequently asked questions
Is this a word-level or line-level diff?
Line-level. Each line is compared as a whole unit, which works well for configs, code, and logs.
Is my text sent to a server?
No. The diff runs entirely in your browser.