Text diff
Compare two pieces of text and see exactly what changed: line by line, or word by word within a line, which is the view that shows you a single altered number.
- Word-level differences inside a changed line, not just "this line differs"
- Ignore whitespace and case when the difference you care about is not those
- Handles files as well as pasted text
- Nothing is uploaded, compare two contracts or two config files safely
Line diffs and word diffs
A line diff tells you a line changed. If that line is a paragraph, you then reread the whole paragraph to find out what. A word diff tells you which words, which turns "this clause changed" into "the figure went from 30 days to 14".
Both are here, because they answer different questions. Line-level is right for code and config; word-level is right for prose, contracts and anything where a single altered number is the thing you are hunting.
Ignoring what you do not care about
Two files that differ only in indentation produce a diff in which every line is changed, and it is useless. Ignoring whitespace collapses that to the changes that mean something. Ignoring case does the same for text that has been through a converter.
Turn them on when the noise is drowning the signal, and off when whitespace matters, in Python, in Makefiles, in YAML, the whitespace is the meaning.
What it is good at, and what it is not
It is good at two versions of the same document. It is poor at documents that have been reorganised: move a paragraph and a diff shows it deleted in one place and added in another, with no indication that those are the same paragraph. That is a limitation of the method rather than of this implementation.
It also compares text, not meaning. Two JSON files with the same data and different key order differ on every line. Format both first, the JSON formatter here will do it, and then compare.
Why local matters here
The things people diff are drafts of contracts, versions of a config file, an old and new export of a customer list. All three are exactly the sort of thing that should not be pasted into a website. Nothing here leaves the tab.
Questions
Is my text uploaded?
No. Both sides are compared in this tab, which is what makes it safe to diff a contract or a config file.
What is the difference between line and word view?
Line tells you which lines changed; word shows you what changed inside them. Word view is the one that finds an altered number in a paragraph.
Should I ignore whitespace?
Only when it is noise. In Python, YAML and Makefiles the whitespace is the meaning, so leave it on.
Why does moving a paragraph show as a delete and an add?
Because a diff compares positions, not content identity. No line-based diff handles moves well.
Can I compare two files?
Yes. Load them rather than pasting, which is easier for anything long.
Why do my two JSON files differ on every line?
Probably key order or formatting. Format both first, then compare.