wdiff
the free wdiff word-level diff
front-end, distributed as a single self-contained static
binary.
What it is
Stock wdiff is a thin front-end that runs
diff and re-formats the line-level output into
word-level markers: deleted words get
[-like this-], inserted words get
{+like this+}. Compared to stock
diff, you see exactly which words changed,
not just which lines.
$ printf 'the quick brown fox\n' > a.txt
$ printf 'the slow brown fox\n' > b.txt
$ wdiff a.txt b.txt
the [-quick-] {+slow+} brown fox
Most useful when two texts differ by a few words but
paragraphs have been refilled — exactly the case where
diff -u shows a whole paragraph as changed.
Install (one line)
The fastest path uses x-cmd:
x eget ljh-sh/wdiff
This installs wdiff, diff, and the
man pages to ~/.local/bin/ and
~/.local/share/man/man1/. See
install for the manual walkthrough
or the binary-only install.
Platform matrix
Every release builds 5 targets via GitHub Actions on native runners. Linux uses musl-static (Alpine toolchain) so the binary runs on Alpine, Debian/Ubuntu, RHEL/Fedora, Arch — every Linux distro — with zero system-library dependencies. There is intentionally no separate glibc/dynamic Linux variant.
| target | runner | linkage | archive |
|---|---|---|---|
x86_64-linux-musl | ubuntu-latest + Alpine 3.20 docker | fully static musl | .tar.gz |
aarch64-linux-musl | ubuntu-24.04-arm + Alpine 3.20 docker | fully static musl | .tar.gz |
aarch64-macos | macos-14 | static, system libc/libSystem | .tar.gz |
x86_64-macos | macos-14 (cross from aarch64) | static, system libc/libSystem | .tar.gz |
x86_64-windows | windows-latest + MSYS2 + mingw64 | fully static (no DLLs) | .zip |
aarch64-windows and additional targets are deferred. Restoring
aarch64-windows would require either LLVM clang with
-target aarch64-w64-windows-msvc, or building
mingw-w64-aarch64 from source.
Quick check after install
$ wdiff --version | head -1
wdiff (GNU wdiff) 1.2.2
$ diff --version | head -1
diff (GNU diffutils) 3.10
$ printf 'the quick brown fox\n' > /tmp/a.txt
$ printf 'the slow brown fox\n' > /tmp/b.txt
$ wdiff /tmp/a.txt /tmp/b.txt
the [-quick-] {+slow+} brown fox
Security
See security for the
source-level audit. Two HIGH findings (both popen()
+ $PATH lookup) are mitigated in the ljh-sh dist
by absolute-pathing DIFF_PROGRAM to the bundled
diff binary, so the runtime binary never
traverses $PATH to find diff.