See exactly what changed.
A fast, private diff tool for code and text. Paste two versions and DiffScope highlights every added, removed and changed line — down to the exact words — in split or unified view. Everything runs in your browser; your data never leaves the page.
Why DiffScope
Split & unified views
Review changes side by side, or inline with + and − prefixes and context — exactly like a pull request. Switch between them from the same comparison.
Line & word highlighting
See added and removed lines like Git, then the exact words that changed inside each modified line — so a one-character edit never hides in a wall of colour.
Copy & export patches
Copy the diff or download a standard .patch file with proper @@ hunk headers, ready to apply with git apply or patch, or attach to a review.
Private & offline
Everything runs in your browser. Your code — secrets, NDA work and all — never leaves the page or touches a server.
Compare anything, privately
DiffScope is a free online diff tool for the moment you have two versions of something and need to know exactly what changed. Paste the original and the modified text into the two panes and it computes a line-by-line comparison with the same Myers/LCS algorithm that powers Git, then highlights the specific words that changed inside each edited line. It works on any text — source code in any language, JSON and YAML, config files, Markdown, or plain prose.
Read the result as a side-by-side split or an inline unified diff, ignore whitespace to hide formatting noise, and copy or download a standard .patch when you need to share the change. Best of all, everything runs client-side in your browser: it is fast, works offline once loaded, needs no account, and never sends your code anywhere — so comparing confidential or NDA material is perfectly safe.
Guides & articles
Plain-language explainers on diffing, patches and the algorithms behind version control.

How Diff Algorithms Work
Every diff tool answers one question: what is the smallest set of edits that turns one text into another? Here's the idea behind LCS and the Myers algorithm.

Line Diff vs Word Diff: When to Use Each
The same change can be shown as whole swapped lines or as a few highlighted words. Here's why both granularities exist and when each one is clearer.

Reading a Git Diff Without the Guesswork
Those @@ headers and +/- lines look cryptic until you know the pattern. Here's how to read a unified diff line by line and never lose your place.
Frequently asked questions
Is my code or text sent to a server?+
No. DiffScope is a fully client-side application. The entire comparison runs in your browser's JavaScript engine, and not a single line of your text is transmitted anywhere. There is no backend that processes your code. That makes it safe for confidential work, commercial code under NDA and any sensitive data — and it keeps working offline after the first load.
What is a diff and why do developers use it?+
A diff compares two versions of a file or text and shows which lines were added, removed or changed. Its standard output is the unified diff — the same format Git produces with git diff. Developers rely on diffs for code review, resolving merge conflicts, tracking changes in configuration and documentation, and creating portable patch files that can be applied to another copy of the code.
What algorithm does DiffScope use?+
DiffScope compares line by line using a Longest Common Subsequence (LCS) approach — the same principle behind the Myers diff algorithm used by Git. Inside modified lines it then runs a second, word-level pass so you can see exactly which words changed, not just which lines. All of this happens locally in your browser, with no size limits beyond your device's memory.
Does DiffScope highlight changes within a line?+
Yes. When a line is modified rather than fully added or removed, DiffScope pairs the old and new versions and highlights the specific words and characters that differ. The rest of the line stays dim, so a one-character typo or a single renamed variable is obvious at a glance instead of colouring the whole line red and green.
What is the difference between the split and unified views?+
The split (side-by-side) view puts the original on the left and the modified version on the right, aligned line for line — ideal for reviewing two full files at once. The unified (inline) view stacks changes in one column with - and + prefixes and a few lines of surrounding context, exactly like git diff in a terminal or a pull request. Switch between them freely; the underlying comparison is the same.
Can I compare files in any programming language?+
Yes, any of them. DiffScope compares text, not syntax, so it works with every programming language — JavaScript, TypeScript, Python, Java, C/C++, C#, Go, Rust, PHP, Ruby, SQL and more — as well as data formats like JSON, YAML, XML and TOML, markup like HTML, CSS and Markdown, and plain configuration files. If it is text, DiffScope can compare it.
Can I export the result as a patch file?+
Yes. After comparing you can copy the diff to your clipboard or download it as a .patch file in standard unified-diff format, with proper @@ hunk headers and a few lines of context. The file can be applied to a repository with git apply or the classic patch command, which makes it a convenient way to share changes without pushing a branch.
How do I ignore whitespace and formatting differences?+
Turn on the "Ignore whitespace" option before comparing. Each line is then normalised — leading and trailing whitespace is trimmed — so only meaningful changes remain. This is the equivalent of git diff -w and is especially useful after running a formatter like Prettier, Black or gofmt, or when comparing files that were edited with different indentation settings.