Compare two versions of code
Paste two versions of a function, a file or a config and review the changes like a pull request: side by side or inline, with changed tokens highlighted and a patch to download.
How to use the code compare tool
- Paste the old code on the left and the new code on the right, or drop the files on them.
- Pick Side by side or Inline, whichever you prefer to review.
- Turn on Ignore whitespace if the code was re-indented.
- Copy or download the unified patch to share or apply it.
What you see
- Line numbers of both versions
- Changed identifiers and values highlighted within lines
- Re-indentation ignored when you want it to be
- A standard unified patch to share or apply
About the code compare tool
Review without a repository
Snippets from a chat, a code review comment, a gist or two downloaded versions of a file: compare them without committing anything anywhere.
Patch out
Download the differences as changes.patch: a standard unified diff, the format used by git and the patch command, ready to attach to a ticket or review.
Frequently asked questions
- Which languages are supported?
- All of them. The comparison works on lines and words, so any programming language, markup or config format works.
- Is it the same as git diff?
- The inline view and the patch use the same unified format. Ignore whitespace works like git diff -b.
- Is my code uploaded?
- No. The comparison runs in your browser, so proprietary code never leaves your device.