Diff Viewer

Compare two text files and see the differences.

Loading...

About Online Diff Viewer

Paste one version into Original, the other into Modified, and the split pane below fills in immediately. Both boxes accept anything textual: prose drafts, log excerpts, YAML and environment files, SQL, CSV rows, minified payloads, licence texts. There is no upload step and no file picker, so the workflow is always select-all and paste.

Reading the output

Removed content sits on the left, added content on the right, aligned so that unchanged lines stay level with each other. Changed lines are shaded across their full width and carry a plus or minus indicator in the gutter. Within a changed line, the exact spans that differ get a stronger mark, which is what makes a one-character edit in a long line findable. The pane itself is read-only: to test a fix, change the text in the boxes above and watch the shading disappear.

Leading and trailing whitespace is ignored

This is the single most surprising thing about the tool and worth knowing before you trust a clean result. Whitespace at the start or end of a line does not count as a difference. Append three spaces to a line and the comparison reports nothing. Reindent a block from four spaces to tabs and the comparison still reports nothing. What does register is whitespace in the middle of a line, such as a single space becoming a double, and any added or removed line, blank ones included. The behaviour is deliberate — it stops reformatting from burying real edits — but it means a clean pane is not proof that two files are byte-identical.

Cutting the noise before you compare

A diff is only as useful as the alignment underneath it. Two JSON documents that differ only in key order and indentation will light up almost every line, so format both sides identically with the JSON Formatter first and compare the results. The same applies to source files: run both through the Code Formatter so that brace style and line wrapping match, and what remains is the change you were looking for. Minified assets are worth expanding for the same reason, since a single-line file gives the comparison nowhere to anchor.

Privacy, limits and the editor itself

The comparison is computed in your tab. Neither side is uploaded, neither is written to browser storage, and refreshing clears both boxes. The one network request the page makes is for the editor component, which is served from this site on first load rather than from a third-party CDN, so there is no second host to unblock and no third party told which pages you open. Two editor defaults are left in place and set the ceiling: the comparison is abandoned after five seconds, and content beyond 50 MB is not compared at all.

Recomputed as you type

The two boxes at the top are the inputs and the split pane below is the result. Change a character on either side and the comparison redraws immediately, so you can narrow down a difference by editing rather than by re-running anything.

Line and character level marks

Whole changed lines are shaded, plus-and-minus indicators appear in the gutter, and inside a changed line the specific spans that differ are marked more strongly. A single altered character in a long line is visible without hunting for it.

Your text stays in the page

The comparison is computed by the editor running in your tab, so neither side is uploaded and neither is stored. The editor itself is served from this site rather than a third-party CDN, so the page works on locked-down networks and keeps working offline once cached.

Frequently Asked Questions

Why does it say the two sides are identical when I changed the whitespace?

Leading and trailing whitespace is ignored when the comparison is computed, which is the editor default and is left in place here. Adding trailing spaces to a line, or reindenting a block from four spaces to tabs, produces no highlighting at all. Whitespace inside a line is compared normally, so turning one space into two mid-sentence does show up, and adding or removing a blank line shows up as a line change. If you are specifically hunting a trailing-whitespace or tabs-versus-spaces bug, this is the wrong instrument.

Why is there no syntax highlighting?

The comparison pane is initialised as plain text rather than as a programming language, so nothing is coloured by syntax and every character renders in the same colour. Only the diff shading tells you what moved. That keeps prose, logs, CSV and config files readable, and for code it keeps your attention on the structural change rather than on token colours.

Can I upload files or drag them in?

No. Both sides are plain text boxes, so the workflow is to open each file in an editor, select all, and paste. There is no file picker, no drag target and no folder comparison. For anything already under version control, a local git diff will be faster and will respect whitespace.

The comparison pane is blank or stuck. What went wrong?

The editor is a few megabytes of JavaScript that has to arrive before the pane can draw, and it is fetched the first time the page opens. It comes from this site rather than a third-party CDN, so a proxy or blocklist that allows this page will allow the editor too, and your browser caches it for later visits. If the pane is still empty after the two input boxes appear, check the browser console for a failed request under /monaco/ and reload.

Can I edit inside the comparison pane?

No, it is read-only by design so that the two text boxes above stay the single source of truth. Make your edit in the Original or Modified box and the pane redraws. There is also no toggle between split and unified view; the layout is always side by side.

How big can the two sides be?

Two editor limits apply, both left at their defaults: computation is abandoned after five seconds, and inputs beyond 50 MB are not compared. In practice the text boxes are the real constraint, since pasting a file of that size into a browser textarea is unpleasant long before the editor gives up. For very large inputs, compare the relevant section rather than the whole file.

How do I compare two JSON files without drowning in noise?

Reformat both sides the same way first, otherwise reordered keys and different indentation swamp the real change. Run each through the JSON Formatter, paste the formatted output into the two boxes, and what is left will be genuine differences in keys and values rather than layout.

Is any of my text sent to a server?

No. The diff algorithm runs in the page against the strings in the two boxes, so nothing is uploaded, logged or written to browser storage, and refreshing the tab clears both sides. The only network request the tool makes is for the editor code itself, which contains none of your content.