How does the text diff work?
The diff splits both inputs into lines, then finds the longest common subsequence (LCS) using dynamic programming. Lines in the LCS are unchanged. Lines from the left side that are not in the LCS are deletions. Lines from the right side that are not in the LCS are additions. The result is rendered side-by-side so you can scan for changes by eye.
Is this a Myers diff?
It is the same family of algorithms — both Myers and the simpler LCS-DP approach produce a minimal-edit-script diff. For tens of thousands of lines this implementation runs in milliseconds in the browser. For very large inputs (hundreds of thousands of lines) you would want a true Myers O(ND) implementation; for the typical config-file or paragraph use case the difference is invisible.
Why are some unchanged lines shown twice?
They are not — unchanged lines render once on each side aligned at the same row. What can look like duplication is the side-by-side layout: the row pairs the left and right copies of the same line so you see context on both panels in sync.
Can it diff JSON, YAML, or code?
Yes — the diff is line-based and language-agnostic. Pretty-print your JSON or YAML first (using the OpenFormatter formatters) so structural changes show up as line changes rather than as a single huge changed line. For code, paste the raw source and the algorithm will line-align matching lines automatically.
What is the difference between line diff, word diff, and char diff?
A line diff treats each line as the smallest unit. A word diff splits each line into tokens and shows which words changed. A character diff is finer still — useful for showing typo fixes. Line diff is the right default for code and config; word/character diffs help when comparing prose where every line is long.
Are my texts uploaded?
No. Both inputs and the diff computation stay entirely in the browser. Open DevTools → Network — clicking around in the diff produces zero requests. Safe for proprietary code, contracts, and internal documents.
Why are my whitespace-only differences highlighted?
Whitespace counts. A line ending with two spaces is a different line from one ending with three. To ignore whitespace, normalise both inputs first — collapse runs of whitespace to single spaces, or strip trailing whitespace before pasting.
Can I diff more than two texts?
This tool compares two at a time. For three-way merges (you, them, base) use a dedicated merge tool like git mergetool, kdiff3, or VS Code's built-in three-way merge view. Pairwise diff is sufficient for the vast majority of comparison tasks.