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
- Paste the original code on the left, or drop the file. The language is detected from the file name or the code itself.
- Paste the new version on the right. Changes are highlighted as you type.
- Step through the changes with F7 / Shift+F7. Choose Unified view to read it like a pull request.
- Export a patch from Export → Download .patch. It applies with git apply or patch.
Why Diffspot
- 40+ languagesJavaScript, TypeScript, Python, Java, C#, C/C++, Go, Rust, PHP, Ruby, Swift, Kotlin, SQL, HTML, CSS, YAML, Dockerfile, Terraform and more, highlighted by a fast Rust lexer.
- Moved code detectedWhen a function moves within a file, it's shown as a move instead of a large delete and add.
- Ignore formattingIgnore indentation changes or all whitespace to focus on real edits after a reformat.
- Unified diff and patchesCopy a unified diff or download a .patch with your file names, ready for git apply.
- Nothing is uploadedThe comparison runs in this browser tab, in WebAssembly. Your text and files are never sent to a server, not even ours, and nothing is saved.
- Fast on big inputsThe diff engine is written in Rust and runs in a background thread, so typing stays smooth. Files with hundreds of thousands of lines compare in about a second.
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.