Diff Viewer

Compare two files side by side

Open in workspace

Diff Viewer: Compare two files side by side. A free, browser-based tool from DevToolbox that runs entirely on your own device: no upload, no account, no tracking.

About the Diff Viewer

Paste two versions of a file and the differences appear as you type, with the changed characters highlighted inside each changed line rather than just the line marked. Compare side by side, inline, or in a three-way merge view where you pick a side per conflict.

The comparison is a longest-common-subsequence diff over lines, the same family of algorithm behind a standard unified diff, followed by a second pass inside each changed pair to find the characters or words that actually moved. Both passes run in your browser as you type, so a 2,000-line file re-diffs in a few milliseconds with no request in between.

What you can do with it

  • Diff checker
  • Compare two files
  • Text compare
  • Code diff
  • Compare text online
  • Side by side diff

How to use it

  1. Paste the original on the left and the new version on the right, or drop a file into either pane.
  2. The diff appears immediately. Additions, deletions and the similarity score update as you edit either side.
  3. Switch between side-by-side, inline and merge with the buttons at the top left, and between character and word granularity beside them.
  4. Use Alt+Up and Alt+Down to jump between changes, or the minimap on the right to jump to one directly.
  5. Copy the diff as text, or download a .patch file you can feed straight to git apply.

Questions

Do I have to press a button to see the difference?
No. The comparison runs as you type or paste. Only very large inputs, over about 300,000 characters or 12,000 lines, wait for the Compare button, because running an LCS diff that size on every keystroke would block the tab.
What algorithm does the comparison use?
A longest-common-subsequence diff over lines, which is what a standard unified diff uses. Lines that changed are then compared again character by character, or word by word if you switch granularity, so you see exactly what moved inside the line instead of the whole line turning red.
Can I get a patch file out of it?
Yes. The .patch button produces a unified diff with proper hunk headers, which git apply and patch both accept. That is the difference between reading a comparison and being able to act on it.
What does the merge view do?
It shows the two versions with each conflicting block resolvable in place: choose the left side, the right side, or both, and the merged result builds up as you go. You can then copy the result out.
Can it ignore whitespace or reformatting noise?
Ignore whitespace treats lines that differ only in spacing as unchanged, and ignore blank lines does the same for empty lines. When both sides are valid JSON, a structural option compares the parsed data instead of the text, so key order and indentation stop counting as changes.
How large a file can it handle?
It is bounded by your browser's memory rather than an upload limit, and files of a few thousand lines compare comfortably. Past roughly 300,000 characters the live comparison switches to manual so the page stays responsive.
Is my data uploaded anywhere?
No. The tool is JavaScript that runs in the tab you already have open, and DevToolbox has no backend to send anything to. You can open the network tab and watch: after the page and its script load, nothing is sent while you work.
Does it work offline?
Once the page has loaded, yes. The tool needs no network access to do its job, so it keeps working if your connection drops. Reloading the page does need the network unless your browser has it cached.

The Diff Viewer sits in Testing & Analysis, one of the 90 tools on DevToolbox.