Paste a git diff or patch file and read it the way a review tool shows it, with both files' line numbers and a check that every hunk header matches its lines.
Waiting for a patch
Paste the output of git diff or diff -u. Nothing is uploaded and nothing is applied.
The patch appears here
Every file, every hunk, both files' line numbers, and any header whose counts disagree with its lines.
Patch Viewer runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
A unified diff is designed to be applied by a program, not read by a person. Line numbers appear only in the hunk headers, a plus sign is a marker on one line and part of the code on the next, and three columns of punctuation sit between you and the change. This renders it the way a review tool does: both files' line numbers beside every line, each hunk separated, and each file's totals in one place.
It reads a patch and does not apply one. Applying means resolving the patch against a working tree, which this cannot see. What it can do is check the patch against itself, and there is one check worth having.
A hunk header is a promise. The header for a hunk claims a number of lines from the original and a number in the result, and the lines beneath it have to add up to both. A patch that has been hand-edited — a line deleted from the middle, a hunk pasted in from elsewhere — usually breaks that promise before it breaks anything else. Applying it fails with a message that points at the content rather than the arithmetic, which sends people looking in the wrong place. Here the mismatch is named, with the numbers the header claimed.
Renames, mode changes and binary files are all things a patch can describe without carrying readable lines, and each is reported as what it is rather than as an empty change. A binary file notice means the patch records that the file changed and does not contain its contents, which is the normal behaviour unless the patch was generated specifically to include them.
The context lines can be hidden, which turns a long patch into a list of just the changes. Useful for a quick read of a large diff, and worth switching back off before concluding anything, because context is how you tell a moved block from a rewritten one. Nothing is uploaded: the patch stays in your browser.
No. Applying a patch means resolving it against a working tree, and this tool has no access to your files. It reads the patch, renders it legibly, and checks it for internal consistency.
The counts in the header do not match the lines beneath it. It almost always means the patch was edited by hand after it was generated. Git will refuse to apply it, usually with an error that points at the content rather than the header.
Because the patch describes something other than a content change: a rename, a file mode change, or a binary file. All three are recorded without readable lines, and each is labelled as what it is.
Unified diffs, which is what git diff, git show, git format-patch and diff -u all produce. Context diffs and side-by-side output are different formats and are not read.
Yes, if you take the raw patch — the .diff or .patch URL, or the output of git diff locally. Copying the rendered page gives you HTML and line numbers rather than a patch.
No. It is parsed in your browser and never leaves the page, which matters because a patch contains your source code.