Orpheus

Compare Two Texts

Line-by-line differences, computed in your browser.

Options
Ignore case
Ignore leading and trailing spaces
Show only changed lines
Result

Everything is processed in this tab. Nothing you paste is sent anywhere.

Every tool runs entirely in your browser. Your files are never uploaded to a server.

A diff finds the longest sequence of lines the two versions share, then reports everything else as added or removed. Lines prefixed with a minus are only in the first version, a plus only in the second.

How to use Text Diff

  1. Paste the first version. The original text goes at the top.
  2. Add a --- separator. A line containing only three dashes marks where the second version starts.
  3. Paste the second version. The changed text goes underneath.
  4. Read the differences. Minus lines were removed, plus lines added, with counts beside them.

About comparing two texts

Comparing two versions of a text is one of those tasks that is trivially easy to describe and surprisingly involved to do well. The naive approach — walk both versions together and report the first mismatch — falls apart as soon as a line is inserted, because everything after it appears changed when nothing was. The standard solution is to find the longest common subsequence: the largest set of lines appearing in both versions in the same order. Whatever falls outside it is reported as removed from the first or added to the second, which produces the smallest sensible description of what happened rather than merely a correct one. This works on whole lines, which is the same granularity version control uses and is a deliberate trade. Changing a single word reports the line as removed and a replacement added, rather than highlighting the word. That is less precise but far easier to scan, and it avoids the noisy output that character-level comparison produces on ordinary prose. The whitespace option matters more than it sounds. Re-indented code, text copied out of a word processor and files that have travelled between operating systems routinely differ in ways that are invisible on screen, and comparing without trimming reports them all. Everything here runs in the browser, which is the practical point: contracts, credentials and unreleased source can be compared without being sent anywhere.

Frequently asked questions

Is my text uploaded anywhere?
No. The comparison runs in your browser using JavaScript, so both versions stay on your machine. That matters for contracts, source code and anything else you would not paste into an unknown server.
Why does a small edit show as a whole line changed?
Because the comparison works on complete lines. Changing one word marks the line removed and a new one added, which is also how version control systems report it. It keeps the output stable and easy to scan.
What does ignoring whitespace do?
It trims spaces and tabs from the start and end of each line before comparing, so re-indented code or text pasted from a document with trailing spaces does not report differences that are invisible on screen.
How does the comparison decide what changed?
It computes the longest common subsequence of lines — the largest set that appears in both versions in the same order — and treats everything outside it as an addition or removal. That produces the smallest sensible set of changes rather than the first one found.
Is there a size limit?
The algorithm uses memory proportional to the two lengths multiplied together, so a few thousand lines each side is comfortable and much larger inputs will get slow. For files that size, a local diff tool is the better instrument.

Last updated