Text Diff

Paste two versions of a text or open two files and see exactly which lines were added, removed or changed, in one column or side by side. The comparison runs inside your browser: your text is never sent anywhere.

Text Diff

or drop a file here. It stays on this device.

How it works

  1. Paste the original text on the left and the changed text on the right, or open one or two files (a single file fills whichever side is empty).
  2. Choose whether to ignore case or whitespace, and whether to see every line or only the changes with three lines of context.
  3. Press Compare. Removed lines are marked red, added lines green, and the changed words are highlighted (in Chinese, each changed character). Show them in one column or side by side; download the result as a unified diff or copy it.

Questions

How are the differences found?

Line by line, with the shortest edit script (Myers' algorithm, the same approach as diff and git). Within a block of changed lines, each removed line is paired with the added line most like it, in the order of both texts (a line split in two or joined to the next still meets its counterpart, and a line unlike all the others stays unpaired), and the words that differ are highlighted, in Chinese each character; a pair of lines longer than 2,000 characters is marked whole instead, and the result names it, as it says when a block of changes is too large to pair line with line within 3 seconds. Line endings (LF, CRLF, CR) are treated as equal.

What does the side-by-side view show?

The same comparison as the one-column view, with the original on the left and the changed text on the right, each with its own line numbers. A removed line sits beside the added line it is paired with, both with their changed words highlighted; an unpaired line sits beside an empty cell, and unchanged lines appear on both sides. Switching between the two views keeps the comparison, its download and its report; side by side, long lines wrap, and on a narrow screen the table scrolls sideways.

What can I ignore?

Case, trailing whitespace, or all whitespace changes inside a line (runs of spaces and tabs are treated as one space, leading and trailing whitespace is dropped). Ignored differences are also left out of the downloaded diff, so a patch made with those options keeps the original's spelling of those lines.

What is the download?

A standard unified diff with three lines of context, its header naming the two files as they were opened. Apply it with patch, naming the file to change (for example: patch original.txt original_vs_changed.diff), or open it in any diff viewer. When the original file has CRLF line endings, the diff has them too, so patch matches its lines; text typed or pasted into the boxes has LF line endings. A missing final line break is recorded the way diff does.

How large can the texts be?

Up to 200,000 lines per side and 32 MB per file. 50,000 lines with a few hundred changes compare in well under a second; comparing two texts that share almost nothing is slower, and after 5 seconds the remaining region is shown as one block replacement rather than the smallest change. The table shows at most the comparison's first 5,000 lines, the same in either view; the download is always complete.

Does it work offline?

Once the page has loaded, yes. Nothing is fetched while you compare, so you can disconnect and keep working.

Can I print a readable report?

Download the complete line comparison as a standalone HTML report. It opens offline and prints or saves as PDF through your browser. The on-screen comparison also offers previous/next change navigation and swapping the original and changed inputs.

Is my text uploaded?

No. The page loads a small script into your browser and every operation runs on your device. You can check this yourself in the browser's network panel: after the page has loaded there are no upload requests. Closing the tab discards the text.

Do I need an account or to pay?

No. These basic tools are free and add nothing to your data. The only limits are the tool's own: 200,000 lines per side, opened files up to 32 MB each. Within them, the practical limit is your device's memory.

What does this page keep in my browser?

Nothing you open or type. While the tab is open, the tool pages keep a short list of the steps taken in it, in the tab's session storage: the step (page opened, started, succeeded, first success, used again or failed), the tool's name, the time, how many files were used and, for a failure, an error code; never a file name, the contents of a file or your text. It holds at most the latest 200 steps, and the browser deletes it when the tab closes. The page never sends it. Where a Report a problem button is shown, you can attach the last 20 steps to your report; nothing is attached unless you tick that box. In local storage the page keeps only choices you made: a Light or Dark theme until you choose System again, the language you picked with the EN / 中文 switch if it differs from your browser's language, and this tool in your recently used list if you switched that list on at the tools page.

Questions or problems

Found a problem or missing feature? Tell us. Please describe the steps; do not send confidential data.