Text Diff
Compare differences between two texts with side-by-side view.
How to Read Text Diff
This tool performs line-level comparison and marks additions (+), deletions (-), and changed lines. Side-by-side output helps you inspect both the content and the order of edits in one view.
Practical Example
Paste the before and after versions of HTML, CSS, or config text to see exactly which lines changed. It is useful for quick static-page edits or document reviews where opening a full Git workflow is unnecessary.
Practical Use Cases
- Pre-deploy checks: compare production and staging config files before release.
- Document revisions: review exactly which lines were changed in policy or contract text.
- Quick code review: share a focused before/after diff outside your IDE.
Common Mistakes
- Whitespace-only changes still count as differences; normalize formatting when needed.
- Swapping original and changed text reverses addition/deletion interpretation.
- Very large inputs can be slower in browser memory; split files by section if needed.
How to Interpret Stats
+ additions= lines only present in the changed text (right panel).- deletions= lines only present in the original text (left panel).- A changed line is counted as one deletion plus one addition.
Normalize Before Comparing to Remove Noise
If the diff shows large numbers of lines that "didn't really change," one of these three causes is almost always responsible.
| Noise source | Symptom | Fix before comparing |
|---|---|---|
| Line endings (CRLF vs LF) | Every line flagged as changed | Convert both texts to one line-ending style |
| Indentation (tabs vs spaces) | Identical lines flagged as changed | Run both through the same formatter first |
| JSON key order | Same structure, everything differs | Sort both with the JSON formatter, then diff |
The JSON key-order case is the most common when comparing API responses: servers do not guarantee key order, so diffing unsorted output hides the actual value changes.
How This Differs from Git Diff
This tool uses the same family of algorithms as Git (diff-match-patch), but serves a different moment: text that is not in a repository yet — a revision received by email, body copy pasted from a CMS, a config file from a vendor. It is the quickest way to review changes before they become a commit, or in workflows that never touch Git. The LCS and Myers algorithms that find the differences are explained in the diff algorithm guide.
FAQ
When should I enable Sync scroll?
Use it for long files when you want both panels aligned. Disable it when you need to inspect unrelated regions independently.
Does it support Unicode text?
Yes. Korean, emoji, and other Unicode characters are compared as regular text lines.
Is compared text stored remotely?
No. Comparison is executed locally in your browser.