How to read a unified diff
A patch describes how to turn one version of a file into another. Each file section starts with --- a/name (the old file) and +++ b/name (the new one). Changes are grouped into hunks; each hunk header such as @@ -12,7 +12,8 @@ means "starting at line 12, 7 lines of the old file become 8 lines of the new file".
Inside a hunk every line has a one-character prefix: a space for unchanged context, - for a line that was removed, + for a line that was added. A changed line is always shown as a removal followed by an addition. The line \ No newline at end of file just records that the last line had no line break.
The viewer above numbers each line in both versions, so you can find it in your editor, and totals what was added and removed per file. To see changes within a line (which word changed), paste the two full versions into the text compare or code compare tool instead; a patch alone has only whole lines.
Questions
What is the unified diff format?
It is the text format produced by diff -u and git diff. Each file starts with --- (old name) and +++ (new name) lines, followed by hunks that begin with @@ -start,count +start,count @@. Inside a hunk, lines starting with a space are unchanged context, lines starting with - were removed and lines starting with + were added.
Can I paste the output of git diff or git show?
Yes. The viewer skips git's extra header lines (diff --git, index, commit messages) and reads every file in the patch, so a multi-file git diff, git show or a GitHub ".diff" download all work.
Can I get the original and changed text back from a patch?
Partly. A patch only contains the changed lines plus a few lines of context, so it cannot rebuild whole files. The viewer can copy the "before" and "after" side of every hunk, which is often all you need to review or re-apply a change by hand. To recreate the full new file, apply the patch to the original with git apply or patch.
Is my patch uploaded?
No. The patch is parsed by JavaScript in your browser tab and never sent anywhere.
How do I make a patch from two texts?
Paste both versions into the text compare tool and press "Download .diff" or "Copy patch". On the command line, diff -u old.txt new.txt > changes.diff or git diff --no-index old.txt new.txt produce the same format.