PasteDiff

Diff code without a repo: paste two versions of a snippet below. Changed tokens are highlighted inside each line, and Copy patch exports a git-style unified diff. The sample is a small refactor.

Paste text above and hit Compare (or just type — it updates live).

When the code isn't in a repo

git diff is the right tool when both versions are committed. But half the diffs you actually need aren't: a function from a blog post vs what's in your editor, a colleague's paste vs yours, a snippet from an AI assistant vs the original, the same file on two servers, a Stack Overflow answer vs what you tried. Paste both versions above and you get a proper diff — Myers algorithm, the same family git uses — with the changed tokens highlighted inside each changed line, so a one-argument change doesn't read as a whole rewritten line.

Export it as a real patch

Copy patch produces a standard unified diff — @@ hunk headers, three lines of context, the same format as diff -u and git diff. It applies cleanly with patch -p0, drops into a code review comment, or documents a hotfix made outside version control.

Whitespace and other noise

Tick Ignore whitespace to hide indentation-only churn (a reformat, tabs vs spaces). If two "identical" snippets stubbornly show differences, the culprit is usually an invisible character that rode along with the copy — a zero-width space or non-breaking space from a web page or chat app. TextWash shows exactly which, character by character.

Safe for code you can't share

Proprietary code never leaves your machine: the page is static and the diff runs entirely in your browser. Comparing API responses or config blobs instead? The JSON diff normalizes formatting and key order so only semantic changes show.