What a Diff Is and Why It Matters

A diff — short for difference — is a structured way of showing what changed between two versions of a text. Rather than reading both documents in full and trying to spot changes manually, a diff highlights only the lines that differ, making review fast and reliable.

Diffs are fundamental to software development: every pull request you've ever reviewed was powered by a diff. But the same concept applies far beyond code. Contract negotiation involves comparing draft versions. Configuration management requires auditing what changed between releases. Document editing benefits from seeing exactly what a collaborator added or removed. Any situation where "what changed?" is the key question is a situation where a diff tool saves time.

How the Myers Diff Algorithm Works

Most diff tools, including this one, use a variant of the Myers diff algorithm, published by Eugene Myers in 1986. The algorithm solves a specific problem: given two sequences, find the shortest edit script — the minimum number of insertions and deletions — that transforms one sequence into the other.

In practice, this means the diff you see isn't just "everything that's different" — it's the most efficient explanation of the difference. When two lines move from one place to another, a good diff algorithm recognises this as a move rather than a deletion and an unrelated insertion. The result is a diff that's easier for humans to read and reason about.

The algorithm operates on lines by default. Each line is treated as an atomic unit, and the diff shows which lines were added (marked with a + prefix, typically green) and which were removed (marked with a - prefix, typically red). Unchanged lines provide context — usually a few lines above and below each change — so you can understand what surrounds each edit.

Line-Level vs Character-Level Diffs

Line-level diffing is the standard for code, configuration, and most documents. It's fast and produces a result that matches how developers and editors think about changes: in terms of lines.

Character-level diffing goes deeper. Instead of marking the entire line as changed, it highlights the specific characters within a line that differ. This is especially useful for subtle changes like:

The diff checker supports both modes. Use line-level for broad structural review; switch to character-level when you need to catch fine-grained changes.

Practical Use Cases

Comparing API Responses

When debugging an API, you often need to compare a response from two different environments, time periods, or endpoints. Paste the JSON from both and the diff immediately shows structural changes, new fields, removed keys, or altered values. This is faster than eyeballing two terminal windows side by side.

Reviewing Legal and Contract Documents

Contract negotiations frequently involve tracked changes in Word — but not always. When you receive a new draft as a clean document and need to know what changed from the previous version, paste both versions into the diff checker. Legal language is dense enough that even experienced lawyers miss small word changes on manual review. A diff surfaces them instantly.

Auditing Configuration Changes

Before deploying a configuration change, diffing the old and new config files is a standard sanity check. The diff tells you exactly which settings changed, which makes it easier to reason about the impact and catch unintended modifications. This is particularly useful for nginx configs, environment variable files, Kubernetes manifests, and any structured format where ordering is consistent.

Document Editing and Collaboration

Shared documents edited by multiple people accumulate changes that aren't always tracked. Paste an older copy alongside the current version to get a precise change log. This works for meeting notes, technical specifications, policy documents, and anything else that gets iterated on over time.

Tips for Getting the Most Out of a Diff

See exactly what changed between two texts.
Paste your old and new versions side by side — changes highlighted instantly, no account needed.

Open Diff Checker →