Skip to content
My Tiny Utils

Search tools

Type to find a tool, then press Enter to open it.

Diff Viewer

Paste two blobs of text, JSON, YAML, or code and read the difference as a syntax-highlighted side-by-side or unified diff.

Processed locally in your browser — nothing is uploaded.

0 characters

0 characters

Detected as Plain text. Pick a format above to override it.

Diff

Paste something into both fields — the diff appears here.

About Diff Viewer

Paste two blobs of anything — prose, a JSON payload, a YAML manifest, an SQL migration, a stylesheet — and read the difference as a proper diff: syntax highlighted, side by side or unified, with the changed words inside a line picked out rather than the whole line struck through.

The format is worked out from what you paste, which decides the syntax highlighting, and you can override it whenever the guess is wrong. “Ignore whitespace” is handed to the diff algorithm, so it changes what counts as a difference while the text on screen stays exactly as you pasted it. Windows and Unix line endings never count as a difference on their own.

For JSON there are two extra options. “Format JSON” re-serializes both sides with two-space indentation, so a minified payload and a pretty-printed one compare on their values instead of differing on every line; “Sort JSON keys” additionally orders keys alphabetically at every depth, which makes a difference in key order disappear. Both rewrite the text the diff displays, so what you see is what was compared.

Common uses

  • Compare two API responses and see which fields actually changed
  • Review an edit to a config file or manifest without committing it first
  • Check a minified JSON payload against a pretty-printed one
  • Read a colleague's rewrite of a document side by side with the original

Example

Input

{"replicas":2} against {"replicas":4}

Output

− "replicas": 2 · + "replicas": 4

Only the changed value is highlighted; with “Format JSON” on, a minified side is re-indented first so layout never counts as a difference.

Limitations

  • Each side is capped at 300,000 characters — past that the browser spends longer drawing the diff than you spend reading it
  • JavaScript and TypeScript are never auto-detected, because nothing separates them reliably from each other or from plain prose; pick them from the format list
  • Comparison is line-based, so moving a block of text unchanged still shows as a removal and an addition