Text diff
Line or word level diff of two texts. Hand-written Myers algorithm, nothing leaves the page.
HOW IT WORKS
This is Myers (1986): the minimum edit script as a shortest path through an edit graph, at O((N+M)·D) in the actual edit distance D. Similar texts compare instantly; unrelated ones are the slow case — which is exactly what everyone tries first.
So the shared prefix and suffix come off first. A real edit touches a small middle span, and trimming often leaves a few percent of the original length. If what remains is still too large, the tool says so rather than freezing the tab — in a browser a runaway loop is indistinguishable from a crash.
Word mode treats CJK per character. Chinese has no spaces, so splitting on whitespace would make a whole paragraph one token and report it entirely replaced over a single character. Splitting ideographs individually keeps the change as small as it actually is.
LIMITS
- It compares text, not structure. For JSON use C05, which knows the difference between a reordered key and a changed value.
- Line mode treats CRLF and LF as equal, or a file from Windows would report every line as changed. To inspect line endings themselves, use B06.