Skip to content

Diff Viewer

Two versions in, every real change out. Reordered keys and trailing whitespace don't count.

Compare

Drop, paste, or type two versions. The differences appear below as you type.

Differences

Markdown preview (rendered, sandboxed)
Reference
How to use it
  1. Load two documents. Type or paste into the left and right panes, or drop a file onto either side.
  2. Pick a format, or let it guess. Auto-detect reads the file extension and a quick content sniff. Override it from the Format menu when you know better.
  3. Read the diff. Side-by-side on desktop, stacked and unified on a phone. Additions are green, deletions are red, and the changed words inside a line are tinted.
  4. Tune what counts. Toggle off whitespace, case, or blank-line changes. Switch between word-level and character-level highlighting.
  5. Take it with you. Copy or download a unified .patch, or hit Share link to put the whole comparison in a URL.

Keyboard: Alt+↓ and Alt+↑ jump to the next and previous change.

What “smart” means

The viewer picks a strategy per format instead of treating everything as text:

  • JSON parses both sides and compares structure, so key order and indentation never register. One changed value is one changed line.
  • YAML parses to the same canonical, key-sorted form before diffing. Reordering a mapping is a no-op.
  • XML and HTML are pretty-printed by the browser’s own parser, then compared line by line.
  • CSV is parsed into a table and diffed cell by cell, so a single edited field doesn’t flag the whole row.
  • Markdown gets a line-and-word diff plus a live rendered preview.
  • Source code — 25+ languages (Python, C, C++, Java, Go, Rust, C#, TypeScript, Ruby, PHP, SQL, and more) get per-language syntax highlighting on every line, including the changed ones, auto-detected from the file extension or pasted content. Optional toggles ignore comment-only edits and treat reordered imports as unchanged, and long runs of unchanged lines fold into expandable, function-labelled separators.
  • Plain text falls back to a classic line diff with word-level highlights.

If a document won’t parse as its claimed format, the viewer says so and compares it as plain text instead. Nothing throws.

Privacy

Everything runs in your browser. The two documents, the diff, the patch, the share link: none of it is uploaded, because there is no server to upload to. The libraries are bundled into the page, so it works offline and keeps working if this site ever goes away. Close the tab and the only trace left is whatever you copied to your own clipboard, plus a draft saved to your browser’s localStorage so the panes survive a reload.

FAQ
Does it send my files anywhere?

No. The diff is computed locally in JavaScript. There are no network requests after the page loads.

How big a file can it handle?

Drops are capped at 2 MB, and binary files are rejected. Past about 2,000 lines the viewer drops intra-line highlighting and re-diffs when you click away rather than on every keystroke, to stay responsive.

Why does reordering JSON keys show no change?

Because JSON objects are unordered by definition. The viewer compares the parsed structure, not the text. Turn off “Sort keys” if you want key order to count.

What does the Share link contain?

Both documents and your current options, compressed into the URL after the #. The link never hits a server, so very large inputs can make it too long for some apps to pass around.

Can I diff two different formats?

You can, but it is rarely useful. The viewer detects one format for the pair. Set it explicitly from the Format menu if auto-detect guesses wrong.

Does it highlight source code?

Yes — 25+ languages, detected from the file extension (.py, .cpp, .rs, .go, …) or, for pasted snippets, from the content. Both the unchanged context and the changed lines are syntax-highlighted; changed lines also keep the word-level diff. Pick a language by hand from the Format menu if auto-detect guesses wrong. (A .h header is treated as C — switch it to C++ if you need C++-only keywords.)

What do “Ignore comments” and “Ignore import order” do?

“Ignore comments” drops comment-only edits, so a reworded comment isn’t flagged — line and single-line block comments, with multi-line blocks handled best-effort. “Ignore import order” treats a run of import / #include / use lines as a set, so reordering them shows nothing (it canonicalizes their order in the view).

What is “Fold unchanged”?

Long stretches of unchanged lines collapse into one separator, labelled with the enclosing function or class, so a small change in a large file stays readable — click a separator to expand it. It also keeps very large files fast.

Comments

Related

Recent