
Zoltan Horvath
I start by asking what changed, because the three levels answer different questions and picking the wrong one produces a diff nobody can read. A line diff compares whole lines and reports which were added, removed or altered. It is the right level for source code and for configuration, because a changed line is the unit of meaning there. It is poor for prose, where a sentence spanning several lines produces a diff that looks like a rewrite. A word diff works inside a changed region and marks the specific tokens that differ. This is what you want for documents, and it is where whitespace handling matters: a tool that treats a re-indent as a change will report a document as heavily edited after an editor converted its line endings. A character diff goes finer still and is the right choice for code where a one-character change has a large effect, such as a comparison operator. Past that it stops being readable. Every diff tool needs the same three inputs and gets them wrong in different ways: which whitespace is significant, whether line ending differences count, and how large a changed block has to be before it is split into two. Two tools given the same pair of files can produce different output without either being wrong, which is why a diff should always be read with the settings shown. I also cover the case where a diff is not the answer: a reordered file, where almost every line changed position, tells you nothing useful. The other case worth naming is a change in file format. A document saved by a different tool can be reported as wholly rewritten when the content is identical, which is the one situation where a diff is actively misleading rather than merely unhelpful.
About ToolSura
ToolSura offers 80+ free, privacy-first online tools that run 100% in your browser — no uploads, no logins. Learn more about our mission →