What a diff shows
A diff is the smallest set of changes that turns one text into another. The tool finds the longest run of lines the two versions have in common, in order, and reports everything else as either removed from the original or added in the new version. When a removed line and an added line sit in the same place, it compares them word by word, so a changed value stands out instead of the whole line looking different.
It is the fastest answer to "what changed?" — which is the first question in most incidents. A config that worked yesterday, a response that differs between two environments, a deployment manifest before and after someone's edit: putting them side by side turns guessing into reading.
Config drift
Compare the same file from two servers that should be identical. The one line that differs is usually the reason one of them misbehaves.
Before and after a deploy
Diff the rendered config or manifest from the last good release against the current one.
API responses
Compare the output of staging and production, or of two versions. Format the JSON first so that each field is on its own line.
Log excerpts
Compare the log of a failing run with a successful one. Strip the timestamps first, or every line will differ.
Getting a clean diff
A diff is only as useful as its noise level. If two files differ in indentation or line endings, every line shows as changed — tick "ignore whitespace" to see past it. For JSON and YAML, key order and formatting produce false differences, so run both sides through the same formatter and sort the keys before comparing. And keep "hide unchanged lines" on for long files: three lines of context around each change is the convention, and normally all you need.
The "unified" view is the format git diff and diff -u produce: one column, removed lines marked - and added lines marked +. Copy it into a ticket or a chat message when you need to show someone exactly what changed.
Frequently asked questions
How do I compare two text files online?
Paste the contents of the first file on the left and the second on the right. Differences are highlighted as you type: red for lines removed from the original, green for lines added.
Is my text uploaded?
No. The comparison runs in your browser and nothing is sent to a server, so it is safe for configuration files and other internal data.
What is a unified diff?
A compact format in which both versions are shown in one column. Lines starting with - exist only in the original, lines starting with + only in the new version, and unmarked lines are context.
Why does every line show as different?
Usually invisible differences: Windows versus Unix line endings, tabs versus spaces, or trailing spaces. Turn on "ignore whitespace". Line endings are normalised automatically.