# Diff checker

Paste two versions of a text to see which lines were removed and added, with the changed words marked. Copy the changes as a patch. Nothing is uploaded.

Page: https://toolkitnow.org/tools/diff-checker/

Paste the original text and the changed text. The differences show below as you type. The gray text is an example.

## Good to know

### How lines are matched

As few lines as possible are marked removed and added (Myers' algorithm, as in `git diff`). A line that moved shows as removed in one place and added in another. Inside a changed line, the words that changed are marked.

### Ignoring spaces and case

With spaces and tabs ignored, `a = 1` and `a=1` count as the same line, and so do lines that differ only in a missing final line break, as with `diff -w`. A blank line still counts, and so does a no-break space. With case ignored, `Hello` and `hello` are the same.

### Line breaks

Windows and Unix line breaks count as the same. A text without a line break after its last line differs from one with: its last line shows as changed, and the patch says `\ No newline at end of file`.

### Hidden characters

Inside a change, characters you cannot see are named, such as NBSP no-break space, ZWSP zero-width space and TAB, so two lines that look alike show why they differ.

### The patch

The changes in unified format, as `diff -u` writes it, with 3 lines around each change and Unix line breaks. Apply it with `patch original.txt < changes.patch` (a file with Windows line breaks needs converting first, as with `dos2unix`). With an Ignore option on, the differences it ignores are left out.

### Open from a link

`?a=first%20text&b=second%20text` opens the page with both texts.

Runs in the browser; nothing is uploaded. Part of toolkitnow.org.
