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 = 1anda=1count as the same line, and so do lines that differ only in a missing final line break, as withdiff -w. A blank line still counts, and so does a no-break space. With case ignored,Helloandhelloare 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 -uwrites it, with 3 lines around each change and Unix line breaks. Apply it withpatch original.txt < changes.patch(a file with Windows line breaks needs converting first, as withdos2unix). With an Ignore option on, the differences it ignores are left out. - Open from a link
?a=first%20text&b=second%20textopens the page with both texts.