plato·diff
Open DevTools → Network and paste two texts. You'll see zero requests. The diff runs entirely with the JavaScript engine on this page. Unlike diffchecker.com, there is no upload, no saved-diffs feature, no share-URL. View source on GitHub.

Text Diff & Compare

Paste two texts. See line-by-line differences side-by-side or inline. JSON-aware. Nothing ever leaves your browser — verifiable in DevTools.

Left (original)0 lines
Right (changed)0 lines
Paste two texts above and click Compare. Or just start typing — the diff updates automatically (debounced).

How to use

  1. Paste the original text on the left and the changed text on the right. The diff updates as you type (300ms debounce).
  2. Toggle Side-by-side for code review or Inline for narrow snippets and mobile.
  3. Use Ignore whitespace to compare reformatted code; Ignore case for case-insensitive matches; Semantic JSON to normalize before diffing.
  4. Word-level highlights mark changed words inside modified lines. Turn off for very long lines or low-vision contrast.
  5. Click Copy as unified diff to grab a Git-style diff for PR descriptions, tickets, or email.
  6. Use ↕ Swap to flip sides if you pasted them in the wrong order.

Frequently asked questions

Does any text leave my browser?

No. All diff computation happens locally in JavaScript. There is no server endpoint. You can verify in DevTools → Network: zero requests when you paste.

How is this different from diffchecker.com?

diffchecker.com uploads diffs to its servers — that's how the Saved Diffs and share-via-URL features work. For sensitive data (code with secrets, configs with API keys, internal documents), that's a problem. This tool runs entirely in your browser. No upload, no save, no share-URL unless you explicitly opt in.

What diff algorithm does it use?

A Longest Common Subsequence (LCS) line diff at the top level, with an optional word-level pass inside changed lines. Output is similar to Git's default diff and intuitive for code, config, and document comparisons.

Can I diff JSON or YAML?

Enable Semantic JSON to parse both sides as JSON, sort keys recursively, and pretty-print before diffing. This removes false positives from key-order or whitespace differences. YAML support is on the roadmap.

What's the max file size?

Up to about 1 MB per side runs smoothly in modern browsers. Beyond that, the LCS algorithm slows because it's O(n×m). For very large files, diff locally with git diff or VS Code; this tool is optimized for the 1K–50K-line range.

Side-by-side or inline view?

Both — toggle with the view switch above the diff. Side-by-side is best on wide screens for code review; inline is best on mobile or for short snippets.

Can I ignore whitespace?

Yes — the Ignore whitespace toggle collapses leading/trailing whitespace and treats runs of whitespace as equivalent. Useful when comparing reformatted code or pasted text that has tabs vs spaces.

Can I export the diff?

Click Copy as unified diff to get the standard Git-style format ready to paste into a PR description, ticket, or email. Output is plain text — no images, no proprietary format.

Is the source open?

Yes, on GitHub. The diff algorithm is about 100 lines of plain JavaScript. Audit it to verify the privacy claim — no fetch, no XHR, no WebSocket, no analytics-on-input call.

What about images or PDFs?

Text only in v1. Image and PDF diff are on the roadmap but lower priority — text-diff is the broader use case and the privacy gap from incumbents is wider.

Examples

Comparing config files

Paste your old docker-compose.yml on the left and the new one on the right. With Ignore whitespace on, you see only the meaningful changes.

- image: nginx:1.24
+ image: nginx:1.27

API response comparison

Two JSON responses with different field order. Enable Semantic JSON — the diff normalizes both sides and shows only real differences.

{"a":1,"b":2}
{"b":2,"a":1}
→ 0 differences (semantic)

Code review for secrets

Paste a config file with an API key on the left and a sanitized version on the right. Verify the redaction happened. All locally — the original config never leaves your machine.

- API_KEY=sk_live_abc...
+ API_KEY=<redacted>

About text diff tools

Diffing two texts is one of the oldest problems in computing. The classical algorithm — Hunt & McIlroy 1976, Myers 1986 — finds the longest common subsequence (LCS) between two sequences of tokens (lines, words, or characters) and reports the differences as a script of inserts and deletes. Git, mercurial, vimdiff, and every IDE use a variation of this algorithm. The user-facing display is what varies: side-by-side, inline, three-way, with or without word highlights.

The privacy story matters because diffs often contain secrets. Code being reviewed contains API keys. Config files contain database passwords. Internal docs contain customer data. Uploading a diff to a third-party service — which is what most online diff tools do — turns a private comparison into a server-side log entry. The November 2025 JSONFormatter/CodeBeautify breach made the cost of that pattern very concrete: years of pasted credentials were publicly browsable.

This tool was built deliberately as a browser-only diff. The algorithm is ~100 lines of vanilla JavaScript. There is no fetch, no XHR, no WebSocket, no analytics request on input. You can verify all of that in DevTools' Network panel: paste both sides, click Compare, and watch the request count stay at zero. The full source is on GitHub. If a third-party tool ever tried to upload your sensitive code review without your knowledge, the only way to confirm or refute that is by inspecting the network — which you can do for any tool, but few make it easy.

What's still on the roadmap: image diff (visual change detection between two PNGs), PDF diff (extracted-text diff between two PDFs), and YAML semantic diff. These are valuable but lower-priority than nailing the core text-diff experience for the dev-tools audience that hits this site daily.