How to use
- Paste the earlier version into Original text on the left and the newer version into Changed text on the right. If you pasted them the wrong way round, Swap sides flips the two panes.
- Choose a granularity under Compare by — Lines, Words or Characters — and the result redraws the moment you switch.
- Tick Ignore whitespace or Ignore case when re-indentation or a change in capitalisation is noise you don’t want flagged as a real edit.
- Under 200,000 combined characters the comparison runs as you type; past that the live update pauses, and you press Compare (or Ctrl/Cmd+Enter) to run it on demand.
- Check the Added, Removed and Similarity stats below the result, then Copy or Download the marked-up text to drop into a commit message, ticket or email.
How it works
Before anything is compared, both sides are normalised: CRLF line endings become LF, and — if you asked for it — case is folded and runs of whitespace are collapsed. The cleaned text is then split into tokens according to the mode you picked (whole lines, whitespace-separated words, or single characters) and handed to the Myers algorithm, which finds the shortest edit script: the fewest deletions and insertions that rewrite the first token sequence into the second.
Take three lines — alpha, beta, gamma — edited to alpha, gamma, delta. In line mode the shortest script keeps alpha, deletes beta, keeps gamma, and inserts delta. The output renders as:
alpha
- beta
gamma
+ delta
The stat row is arithmetic over those same tokens. Here one line was added and one removed, with two lines shared. Similarity is round(200 × common ÷ (added + removed + 2 × common)), so round(200 × 2 ÷ 6) gives 67%. That formula counts each shared token twice — once on each side — which keeps a symmetric percentage that doesn’t change when you swap the panes.
Use cases & limitations
Line mode carries most of the load: reviewing an edit before you commit it, spotting config drift between two .env files, or checking which lines a colleague touched in a document. Word mode reads far better for prose — a reworded sentence surfaces as a handful of changed words rather than one long red-then-green line. Character mode earns its place on short strings, catching a single transposed digit in a URL or an ID. Diffing two structured payloads is easier if you tidy them first: run each through the JSON formatter so keys line up predictably, then paste both here. For measuring the size of a rewrite rather than its shape, the word counter is the better companion, and the regex tester helps when you want to strip volatile fields before comparing.
The honest limitation is that a shortest edit script has no concept of moved text. Shift a paragraph from the top of a file to the bottom and the tool reports it as one deletion plus one insertion, not a relocation — the two versions are still equivalent, but the diff won’t say so. It is also a comparison, not a merge: there is no three-way reconciliation and no way to accept individual changes. Very large, very dissimilar inputs can hit the 1.5-second search cap in word or character mode, at which point the tool stops and points you to line mode, which tokenises far more coarsely.
Privacy note
Your text never leaves the device. The comparison runs in your browser, and the only network request the tool ever makes is a one-time fetch of its own diff engine — a small script bundled with this site, cached after the first run and carrying none of your input. Copy and Download build their output locally too, so even the exported patch stays on your machine. Watch the network tab while you compare a paragraph if you’d rather confirm that than take our word for it.