Text diff checker

Paste two versions of some text to see exactly what changed, line by line and word by word. Invisible differences, like line endings, trailing spaces and look-alike characters, are found and explained.

Original
Changed
Differences
Paste two texts to compare

Reading the diff

  • Red lines were removed from the original; green lines were added in the changed text.
  • Inside a changed line, the exact words that differ are highlighted more strongly.
  • Whitespace changes are made visible: · for a space, → for a tab, ⍽ for a non-breaking space and ¤ for other invisible characters.
  • Long runs of unchanged lines are collapsed to 3 lines of context. Click to expand them.
  • Click any line to jump to it in the input.

Switch between split view (side by side) and unified view (one column, like git diff). Turn on “only changes” to hide everything else.

Invisible differences it explains

When a line shows as changed but looks the same, one of these is usually to blame. Each is marked in the input it came from, with a one-click fix you can undo:

DifferenceWhere it comes from
Line endings (CRLF vs LF)Windows editors, Git’s core.autocrlf
No newline at end of fileEditors that don’t add a final line break
Trailing spacesEditors and copy-paste
Tabs vs spacesDifferent editor settings
Byte order markSome Windows editors saving as UTF-8
Non-breaking and zero-width spacesWeb pages, Word, Slack, PDFs
Curly quotes and long dashesWord processors and chat apps “smartening” text
Accents encoded differentlymacOS file names, some databases (Unicode NFC vs NFD)
Look-alike letters from other alphabetsCyrillic “а” and Greek “ο” in place of Latin letters

Comparing structured data

Diffs work line by line, so two JSON files with the same data but different formatting will look completely different. Format both with the JSON formatter first, ideally with keys sorted, then compare. The same goes for minified code.

The command-line equivalent

diff -u original.txt changed.txt       # unified diff
git diff --no-index a.txt b.txt         # git's diff, outside a repo
git diff -w                             # ignore whitespace
git diff --word-diff                    # word by word
cat -A file.txt                         # show tabs (^I) and line ends ($)

Checking whether two files are byte-for-byte identical? Compare their hashes with the hash generator.

Questions people ask

Why does the diff say lines changed when they look identical?
Something invisible is different: trailing spaces, tabs versus spaces, Windows versus Unix line endings, a non-breaking space, curly quotes, or an accented letter encoded two different ways. The checker finds each of these, marks the exact character, and explains what it is.
Can I ignore whitespace?
Yes. Choose “trailing” to ignore spaces at the ends of lines, or “all” to ignore every difference in spaces and tabs, like git diff -w. You can also ignore upper and lower case.
Can I get the diff as a patch?
Yes. “Copy diff” gives you a unified diff, the same format as git diff and diff -u, with 3 lines of context. You can paste it into a code review or apply it with git apply or patch.
Is my text uploaded?
No. The comparison runs entirely in your browser, so it’s safe for config files, contracts and anything private.
How big a file can I compare?
Tens of thousands of lines work comfortably. The algorithm is the same one git uses (Myers), and long unchanged stretches are collapsed so you only see what changed.
↑↓ move↵ openesc close