A diff checker that never uploads your files
Compare two files, two config versions, two API responses — and keep them on your own machine. The comparison runs entirely in your browser, and the page is served with a strict security policy that forbids it from making any unauthorized network request at all.
How to use it
- Paste the original text on the left and the changed version on the right, or drop two files directly onto the respective editor panes.
- Read the result. Changed lines are paired and only the words that actually differ are highlighted, so you see the exact value that changed rather than an entire line marked red.
- Press J and K to jump between changes, or click the overview rail down the right edge to navigate anywhere in a long diff.
- Use Copy patch for a unified diff you can pipe straight into
git apply, or Copy link to share the comparison privately.
The Engineering Behind It: Patience Diff vs Myers Diff
Most basic online diff tools implement the standard Myers difference algorithm (published by Eugene Myers in 1986). While Myers diff is mathematically optimal for finding the Shortest Edit Script (SES), it suffers from a well-known developer readability flaw: when moving code blocks or refactoring functions, it frequently splits similar blocks in unnatural, confusing locations.
DevSandbox implements Patience Diff, an algorithm designed by Bram Cohen (creator of BitTorrent) and adopted by Git via the git diff --patience flag. The algorithm operates as follows:
- Unique Line Anchoring: It scans both documents to identify lines that occur exactly once in both the original and the modified version.
- Longest Increasing Subsequence (LIS): It computes the longest common sequence among these unique anchor lines, guaranteeing that major structural boundaries (such as function signatures, class declarations, and top-level JSON keys) stay aligned.
- Recursive Regional Comparison: It uses these anchors as unbreakable boundary pins, recursively running detailed comparisons only on the smaller, isolated text regions between the anchors.
This approach produces diffs that closely mirror human developer intent. It also dramatically optimizes computational complexity: two 20,000-line files compare in roughly 40 milliseconds client-side, whereas an unanchored matrix comparison over the same input would allocate hundreds of megabytes of RAM.
Understanding Unified Diff Hunk Headers (@@)
When you click Copy patch, DevSandbox generates a standard unified diff format compatible with patch and git apply:
@@ -10,6 +10,7 @@
This header tells version control systems where the change occurs:
-10,6: In the original file, the hunk begins at line10and spans6lines.+10,7: In the modified file, the hunk begins at line10and spans7lines (indicating an inserted line).- Three lines of unchanged context precede and follow the modification, allowing patch utilities to locate the insertion point even if other edits have shifted surrounding lines.
What the Colors and Highlights Mean
- Red on the left — A line that exists only in the original version (deletion).
- Green on the right — A line that exists only in the changed version (addition).
- Paired rows with highlights — The line was modified. DevSandbox runs a secondary word-level Longest Common Subsequence (LCS) pass on modified lines, highlighting the exact variable, string, or punctuation token that changed.
- Grey context lines — Identical lines preserved for reading context. Long runs of unchanged lines are automatically collapsed to save vertical space; click to expand or toggle Show unchanged.
Comparison Options: Whitespace and Case Sensitivity
- Ignore whitespace: Suppresses changes that consist solely of space or indentation modifications. Invaluable when diffing code following an automated formatter run (such as Prettier or Black).
- Ignore case: Treats uppercase and lowercase letters as identical during line matching. Useful for SQL query comparisons or case-insensitive config files.
Private Share Links via URL Fragments (#)
Traditional diff sites save your shared comparisons to backend relational databases. Anyone who guesses the short URL or breaches the database gains access to confidential source code. DevSandbox stores shared comparisons exclusively inside the URL fragment (the hash # component of the link). Per RFC 3986, browsers never send the URL fragment over the network to any web server. The content is decoded locally in the recipient's browser tab.
Compare Two Lists Online: Find Additions, Removals, and Differences
Need to compare two lists of items, user IDs, emails, database rows, or SKU codes? DevSandbox acts as an instant list diff checker. Paste your original list on the left and your updated list on the right:
- Find Added Items: Lines highlighted in green on the right show entries newly introduced to the second list.
- Find Removed Items: Lines highlighted in red on the left show entries removed from the first list.
- Identify Modified Values: Paired lines with inline word highlights pinpoint slight typos, suffix variations, or formatting changes between items.
- Case & Whitespace Options: Toggle Ignore whitespace or Ignore case to compare list items without being thrown off by capitalization or stray indentation.
100% Client-Side Privacy Guarantee
Comparing production configurations, database dumps, and API payloads on remote web servers creates serious data leak risks. DevSandbox executes the entire patience diff algorithm in your browser's local memory. Our strict Content Security Policy forbids unauthorized outbound network requests, guaranteeing that your proprietary code never leaves your computer.
Frequently asked questions
Are my files uploaded when I compare them?
No. The comparison runs in your browser, in JavaScript. The page is served with a Content-Security-Policy containing connect-src 'none' (and whitelisted ad delivery), which means the browser refuses every outbound request the page could make. You can confirm it yourself: open DevTools, watch the Network tab, and paste something.
How large a file can I diff?
Large ones. The engine uses patience diff — it anchors on lines that appear exactly once on both sides, then recurses between those anchors, falling back to a full comparison only inside the small regions left over. A pair of 20,000-line files compares in about 40 milliseconds. The practical limit is your device's memory, not a server quota.
Does it work offline?
Yes. Once the page has loaded, everything it needs is already in the tab. Turn off your network and it keeps working.
How can a share link be private?
The text is compressed and placed in the URL fragment — the part after the # symbol. Browsers never transmit the fragment in an HTTP request, so it does not reach our server, a proxy, or any access log. Whoever opens the link decodes it in their own browser.
Can I get a patch I can apply with git?
Yes. Copy patch produces a standard unified diff with three lines of context and correct hunk headers, which git apply accepts directly.
What is the difference between split and unified view?
Split view puts the two versions side by side, which is easier for reading changed values. Unified view stacks removals above additions in a single column, matching what git diff prints and working better on narrow screens.
Can I use this diff checker to compare two lists of text or IDs?
Yes. DevSandbox is ideal for comparing two lists, such as user IDs, database records, email lists, or CSV rows. Paste one list per line on each side, and the patience diff engine instantly highlights added, removed, and modified entries without uploading data.
Is Diffchecker safe for sensitive company data?
Traditional online diff checkers upload your text to remote servers, and some retain pastes in publicly searchable databases. DevSandbox operates with a 100% client-side guarantee: our strict browser Content-Security-Policy (connect-src 'none') makes it technically impossible for pasted code or lists to leave your browser.