Code compare

Diff two versions of source code with syntax highlighting. Your code never leaves your device.

Original
Changed
Nothing is uploaded. The comparison runs on this device.

Add both texts to see the differences here.

Advertisement

Compare two versions of a function, file or config with the readability of a code review tool. The language is detected automatically, changed tokens are highlighted inside each line, and functions that moved are recognized as moves. Because the comparison runs locally, it's safe for proprietary code.

How to compare code

  1. Paste the original code on the left, or drop the file. The language is detected from the file name or the code itself.
  2. Paste the new version on the right. Changes are highlighted as you type.
  3. Step through the changes with F7 / Shift+F7. Choose Unified view to read it like a pull request.
  4. Export a patch from Export → Download .patch. It applies with git apply or patch.

Why Diffspot

Advertisement

Frequently asked questions

Is it safe to paste confidential text or files?

Yes. Diffspot computes every comparison on your device: the page loads the engine once, then your text and files stay in the browser tab. There is no upload and no server-side storage, and ads are shown in a separate sandboxed frame that cannot read the page. How Diffspot works explains the details, and you can confirm it in your browser's network panel.

Which languages are highlighted?

Over 40, detected automatically: see the full list. You can also pick the language in the Syntax menu.

Can I ignore indentation changes?

Yes: Ignore → Ignore changes in whitespace treats re-indented lines as unchanged. Be careful with Python and YAML, where indentation is meaningful.

Can I get a git-style patch?

Yes. Export → Download .patch or Copy unified diff produces standard unified diff output with context lines.

Can I share a comparison?

Yes. Share creates a link that contains both texts, compressed into the part of the URL after #. Browsers never send that part to a server, so the link works without uploading anything. Anyone with the link can read the texts, so share it like you would share the texts themselves.

Is Diffspot free?

Yes. All features are free, with no account, no trial and no limit on the number of comparisons. The site is supported by ads, which never see what you compare.

More comparison tools