← Back to tool

Compare · Review · Patch

Code Diff Checker

Updated: June 2026

When two versions of a function behave differently, the cause is a line you changed and forgot, or a difference between what you wrote and what is deployed. A code diff checker lines the two up and highlights every change, so you can see in seconds what is actually different rather than re-reading both by hand.

Compare Code →

Free · No upload · Unified diff export

Built for source code

Code is unforgiving: a single changed character — a = that should be ==, a missing semicolon, a flipped comparison operator — can change behaviour entirely. That is why the checker offers character-level highlighting inside changed lines, not just line-level marking. When a line is edited, the exact characters that differ are picked out, so a one-character bug is impossible to overlook.

The output renders in a monospace font with line numbers on both sides, so indentation and column positions are preserved exactly as in your editor. Tabs and spaces are kept intact unless you choose to ignore them.

Ignore reformatting noise

Reformatting tools and different editor settings introduce whitespace differences that are not real changes. If one snippet was reindented or had trailing spaces trimmed, a naive diff drowns the real change in noise. Turn on Ignore all whitespace to compare by content only — two blocks that differ solely in indentation will show as identical — or Ignore trailing spaces to drop just the end-of-line noise while keeping indentation meaningful.

This separates "the formatter ran" from "the logic changed," which is exactly the distinction you care about during a review.

Export a unified diff

When you need to share what changed, the tool exports a standard unified diff — the same format produced by git diff and diff -u:

@@ -12,6 +12,7 @@
   const total = items
     .filter(i => i.active)
-    .reduce((a, b) => a + b.price, 0)
+    .reduce((a, b) => a + b.price * b.qty, 0)
+  return Math.round(total * 100) / 100

Copy it to the clipboard or download a .diff file. It pastes cleanly into a pull request comment, a bug report, a chat message or a patch you can apply with git apply. Three lines of context are included around each change, grouped into hunks just like a real patch.

Safe for proprietary code

Pasting source code into a random online tool is a real risk if that tool sends your code to a server — internal logic, keys and comments can leak. This checker never transmits anything. The comparison runs in your browser with JavaScript, so the code stays on your machine. You can confirm there is no network request when you compare, which makes it appropriate even for closed-source and work projects.

Frequently asked questions

How do I compare two code snippets?

Paste the old code on the left and the new code on the right. The tool aligns the lines and highlights every changed, added or removed line, with character-level detail inside edited lines.

Can it ignore indentation changes?

Yes. Turn on Ignore all whitespace to compare code by content only, so a reformatted block with different indentation does not show as changed.

Can I export a patch?

Yes. Copy or download a unified diff with @@ hunk headers and -/+ prefixes, the same format git diff produces, ready to paste into a review or patch file.