admin@likeapro.dev: ~/diff — zsh

// admin tools · 10

Text diff

Paste or drop two versions of a config, file or payload and see every change side-by-side or as a git-style unified patch — down to the character.

// runs locally — nothing is uploaded

SIDE-BY-SIDE local only · 0 bytes sent --:--:--

How it works

What it does

Put the original on the left and the changed version on the right. The diff updates as you type: removed lines in red, added lines in green, and inside each changed line the exact characters that differ are highlighted. Switch between a side-by-side view and a unified view, then copy or download the result as a standard patch. Files dropped on either pane are read by your browser — nothing is uploaded.

How to use it

  1. Paste text into both panes, or drop a file on each (or press open).
  2. Pick --split or --unified. Long unchanged stretches fold away — click a fold to expand it.
  3. Set the options below, and context for how many unchanged lines surround each change.
  4. copy patch gives you a unified diff that git apply or patch -p1 accepts.

The options

ignore whitespace
Like diff -w: lines that differ only in spaces, tabs or indentation count as equal.
trim trailing
Ignores whitespace at line ends only — including the carriage return, so Windows CRLF and Unix LF files compare cleanly.
ignore case
Like diff -i: SELECT and select are the same line.
JSON-aware
Parses both sides, sorts every object's keys and pretty-prints them before comparing, so reordered keys and formatting changes disappear and only real data changes remain.

How the diff works

Lines are compared with Eugene Myers' O(ND) algorithm — the one behind GNU diff and git — using the linear-space "middle snake" variant, so memory stays small on big files. It finds a shortest edit script: the fewest added and removed lines that turn one text into the other. Each block of removed lines is then paired with the added lines that replaced it, and the same algorithm runs on characters, which is where the inline highlights come from. Lines that share less than 40% of their characters are shown as a whole replacement rather than confetti. Hunk headers such as @@ -9,3 +9,4 @@ and the \ No newline at end of file marker follow the GNU format exactly.

FAQ

Are my files uploaded?

No. Files are read with the browser's FileReader and diffed in this page's JavaScript. Close the tab and they're gone.

How big can the inputs be?

Thousands of lines diff in milliseconds. Two completely different 5,000-line files take well under a second. For extreme cases there's a work limit: if it's reached, you still get a correct diff, just not the shortest one, and a warning says so.

Why does a moved block show as a delete plus an add?

A line diff only knows insertions and deletions, so a moved block appears as removed in one place and added in another. That's how git and GNU diff show it too.

Can I apply the patch with git?

Yes. Load files with their real names (or rename the a/ and b/ paths in the header), save the output as changes.patch, and run git apply changes.patch in the repository.