Skip to content

Diff checker: compare text and files

Compare two texts or files and see every change, line by line and word by word. Everything runs in your browser.

Original

0 lines

Changed

0 lines

Paste or open the original and the changed text. Differences appear here.

How to compare two texts

  1. Paste or open the first version under Original and the second under Changed, or select Sample to try an example.
  2. The differences appear below: removed lines marked − and added lines marked +, with the changed words highlighted inside each line.
  3. Jump between changes with the arrow buttons, or press N and P while the differences have focus.
  4. Copy unified diff or download changes.diff to share the changes or apply them with patch.

Options

View
Side by side (the default) shows the two versions in columns; Inline shows each change’s removed lines followed by its added lines. Narrow screens always use the inline view.
Highlight changes by
Word (the default), Character or Line: how finely changes are highlighted inside a changed line. Line marks the whole line. Lines are always matched first.
Ignore whitespace
Lines that differ only in the amount of spaces, tabs or indentation, including spaces at the end of a line, count as equal. Each side still shows its own text.
Ignore case
Upper and lower case letters count as equal.
Swap
Exchanges the original and the changed text.
Files
Up to 50 MB per file (20 MB on phones and tablets). Above 5 MB (2 MB on phones and tablets) comparing may be slow.

How the comparison works

The texts are split into lines and compared with the Myers algorithm, the same approach as diff and git diff, using the open-source jsdiff library in a background thread. Pairs of changed lines are then compared again word by word or character by character; lines longer than 10,000 characters are marked as a whole. Only the visible rows of the result are drawn, so results of tens of thousands of lines scroll smoothly. Windows (CRLF) and Unix (LF) line endings count as the same line break.

Troubleshooting

  • Every line is marked as changed. Often the indentation differs (tabs vs spaces) or lines end with extra spaces. Turn on Ignore whitespace.
  • “Too different to compare quickly.” The texts share almost nothing, so the comparison stopped after 10 seconds. Check that the right files are loaded, or compare smaller sections.
  • The last line is marked although it looks the same. One version ends with a line break and the other doesn’t; patches record this as a change too.

How your data stays private

Everything happens in your browser, on your device. Your files and text are never uploaded, never stored, and never put in the address bar.

  • The site’s security policy (connect-src 'self') tells your browser to block any attempt by the page to send data to another server.
  • Only your preferences, such as the theme and a tool’s last-used options, are saved in your browser’s local storage. Never your content.
  • To check it yourself, open your browser’s developer tools, select the Network tab, and use the tool: no request carries your data.

There is no account, no sign-up and no watermark. After your first visit, pages open without a connection; a tool’s larger parts, such as the PDF and image engines, are saved the first time you use it, so it works offline from then on.

Frequently asked questions

How do I compare two files?

Select Open file in the Original pane and choose the first file, then Open file in the Changed pane for the second. The differences appear below as soon as both are loaded: removed lines in red with a minus sign, added lines in green with a plus sign, and the changed words highlighted within each line.

Can I ignore whitespace or letter case?

Yes. Turn on Ignore whitespace to treat lines as equal when they differ only in spaces, tabs or indentation, and Ignore case to treat upper and lower case as equal. Each side still shows its own text.

Is my text uploaded?

No. The comparison runs in a background thread in your browser, on your device. Nothing you paste or open is uploaded, stored or put in the URL, and the site’s security policy blocks the page from sending data to other servers.

Can I see word-level differences?

Yes, and it’s free. Choose Word to highlight the changed words within each changed line, Character for single-character edits, or Line to mark whole lines only.

Can I get the changes as a patch?

Yes. Copy unified diff (or download changes.diff) gives the standard format used by diff -u, git diff and patch, with 3 lines of context around each change.