How to use it 01 Paste the original text on the left and the changed text on the right. 02 Pick a granularity: line for prose and code edits, word for changed sentences, character for punctuation-level work. 03 Toggle ignore case or ignore trailing whitespace when those differences should not count. 04 Read the stats cards — edit distance, similarity, lengths and unchanged count — then inspect the side-by-side or unified view and copy what you need.
Worked readouts Comparing a five-line function against a seven-line revision:
Metric
Line mode
Word mode
Shared units
3
34
Inserted / deleted
4 / 2
19 / 5
Edit distance
6
24
Similarity
50.0%
73.9%
Length
5 → 7
39 → 53
In line mode the panel pairs the first two changed lines into "modify" rows with the changed words highlighted, then shows three equal lines and two inserted lines — 7 side-by-side rows in all. Word mode sees the same edit as far less severe: 24 token edits across 92 tokens gives 73.9% . Comparing a text with itself reads distance 0 , similarity 100% , and an empty unified diff.
How the algorithm reads a change Myers' algorithm finds a shortest edit script — the minimum number of insertions and deletions that turns one token sequence into the other — in time proportional to the edit distance, which is why it stays fast on similar files. The panel reports distance as inserted + deleted units, and similarity as 2·LCS / (|a| + |b|), where LCS is the length of the longest common subsequence; a two-line change in a five-line file (three lines untouched) therefore costs 4 edits and reads as 60% similar. Line mode then merges an adjacent delete-then-insert pair into a "modify" row and runs a word-level pass inside it, which is why the display looks like an editor's diff rather than a pile of red and green lines.
Limits and honest assumptions
Token caps. Each side is capped at 20,000 tokens; beyond that the panel asks for a coarser granularity rather than freezing.
No move detection. A block moved from one place to another is reported as a deletion plus an insertion, and similarity drops accordingly.
Whitespace is a token. Word mode splits on whitespace and punctuation, so reformatting shows up as real edits unless you turn on the ignore options. What it does not do. It does not merge three versions or resolve conflicts, and it does not compare binary files — JWT and Cron handle their own formats.
Moving one block rewrites the score Take six lines, move the first line to the end, and a line diff reports two edits; move a paragraph across a 500-line file and the same visual change can report dozens, because every shifted position may break the alignment. Granularity matters too: character mode on a code file turns one renamed variable into hundreds of edits, while line mode hides everything inside a changed line. Read the similarity number with the granularity in mind, and when a move matters, compare a rebuilt text or inspect the unified diff rather than trusting the percentage.
Where it is used Reviewing a change before it ships Paste the before and after of a config or a generated file, read the unified diff, and check that every hunk is intentional — the insertions are exactly the lines you meant to add.
Checking that a transformation was lossless Reformatting, redaction or templating should change only what it claims to change; the diff shows the untouched lines as equal and quantifies whatever else moved.
Privacy Both texts and the computed diff stay in your browser; nothing is uploaded, stored or logged.
References
Myers, E.W., An O(ND) Difference Algorithm and Its Variations , Algorithmica 1(2), 251–266, 1986, doi.org (访问日期:2026-10-07)— the shortest-edit-script algorithm.
Wikipedia, Diff , en.wikipedia.org (访问日期:2026-10-07)— diff formats, hunks and unified syntax.
Wikipedia, Longest common subsequence , en.wikipedia.org (访问日期:2026-10-07)— the similarity measure's basis.
GNU Project, Diffutils manual , gnu.org (访问日期:2026-10-07)— the reference command-line diff behaviour.
Calculators in this hub
Hand-picked tools, one click away. The mini versions compute live and carry your values into the full calculator.
Sources & review
Reviewed by CalcX Editorial Team
Updated 2026-10-07